mutliuser OAuth

44 views
Skip to first unread message

Elroy Paisley

unread,
Sep 17, 2013, 5:10:10 PM9/17/13
to 140dev-oaut...@googlegroups.com
Hi there, I am trying to write a PHP script that will retweet a given tweet ID#.  I'd like it to be flexible enough to retweet from different users depending on certain criteria.  So I assume I need a multiuser OAuth setup but have NO idea how to get started.  Can anyone point me toward code samples or tutorials?

Thanks
EQP

Andrea Fernández

unread,
Oct 11, 2013, 11:53:43 AM10/11/13
to 140dev-oaut...@googlegroups.com
That is a very complicated thing. The 140dev framework was constructed for single-user oauth Streaming API request. To go multi-user, you'll need to request twitter for credentials for each user that enters your website (access_token and access_token_secret), store them in a database an also your app has to be able to identify the user through cookies when he comes back to the site, then you search for the credentials in your database and sign the requests that will do the retweets with this unique, individual credentials. Retweets are supported by a different API, the REST API. This framework is for the Streaming API, which has nothing to do with retweets. I'm afraid to tell you're in the wrong path for what you're trying to do. I suggest you go for Abraham's Twitter Oauth library for PHP, wich uses the REST API that supports retweeting.

REST API resource for retweets
: https://dev.twitter.com/docs/api/1.1/get/statuses/retweets/%3Aid
Abraham's PHP Library to support OAuth for Twitter's REST API (this library is recommended by Twitter): https://github.com/abraham/twitteroauth
Reply all
Reply to author
Forward
0 new messages