php - How to send direct messages from an application's screen_name via OAuth (Twitter) -


i'm getting little confused on seemingly simple concept. i'm building web app notify users via twitter direct message if event occurred on account me. i'm building in php cakephp underlying framework. i'd able send direct message "from" application via oauth. used twurl console (at http://dev.twitter.com/console) send post request via

http://api.twitter.com/1/direct_messages/new.xml?screen_name=<my screenname>&text=<content of dm> 

when check dm's dm myself. because twurl console uses screenname when sending stuff applications or because when calling direct_message/new.xml sending dm account authenticated test application in twurl. in end i'm looking accomplish same thing spontwts - notify via dm when happens on account. input, resources, links, or code samples appreciated :)

you can send direct message via screen name of followers userid screen name of person,

configurationbuilder cb=new configurationbuilder();  cb.setoauthaccesstoken("your app access token");  cb.setoauthaccesstokensecret("your app token secret");  cb.setoauthconsumerkey("your app consumerkey");  cb.setoauthconsumersecret("your app consumersecret");  cb.setincludertsenabled(true);   twitterfactory tf=new twitterfactory(cb.build());   twitter twitter=tf.getinstance();  twitter.senddirectmessage(userid, "message"); 

and provide read/write/direct message permission in app.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -