php - How to send direct messages using OAuth? -


I'm trying to create a Twitter app. I have received my application at a point where users log in via Twitter's user verification system. I can also send status updates using my application. I have this function to send status updates to:

  function sendTweet ($ tx) {$ consumer_key = 'My Consumer Key'; $ Consumer_secret = 'My Consumer Secret'; $ Twitter = new appetizer ($ consumer_key, $ consumer_set); $ Twitter-> SetToken ($ _ session ['OT'], $ _ session ['OTS']); $ Text = $ tx; $ Position = $ Twitter- & gt; Post_State Update (array ('position' = & gt; $ text)); $ Status- & gt; reaction; }  

This sendTweet ($ tx) function works like a charm, but now what I have to do is get a list of users' followers and Then send direct message to them How do I use oauth and PHP?

  function sendDirectMessage ($ user, $ message) {$ Consumer_key = 'Your Consumer Key' ; $ Consumer_secret = 'Your Secret'; $ Twitter = new appetizer ($ consumer_key, $ consumer_set); $ Twitter-> SetToken ($ _ session ['OT'], $ _ session ['OTS']); $ MyArray = array ('user' = & gt; $ user, 'text' = & gt; $ message); $ Resp = $ Twitter- & gt; Post_direct_message ($ myArray); $ Resp-> reaction; }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -