doubi1818 2013-04-21 15:10
浏览 38

让Twitter用户获得家庭饲料的简单方法

Does anyone know a good way to, using oAuth, retrieve a users home feed (using PHP or JavaScript)? I've been searching the web (Google, YouTube and the Twitter website), but have not yet found a simple tutorial like developers.facebook.com has.

If you know of a good tutorial, or you have written some code that works, I'd be glad to see it. I would prefer the entire process, from authorizing a user to displaying their feed, but anything is better than what I have now.

Hoping for answers!

  • 写回答

1条回答 默认 最新

  • dongweihuai5601 2013-04-21 15:13
    关注

    OAuth is method for authentication, you should use REST API provided by Twitter.

    Please check this: https://dev.twitter.com/docs/api/1.1 (statuses/user_timeline)

    Edit:

    https://github.com/abraham/twitteroauth

    Please check "Extended flow using example code" section, there's everything you want to know.

    Just one note, if you have long-live access token (from your app dashboard, see oauth tab), you just pass token and token secret as third and fourth parameter when you create new instance of TwitterOAuth class, like this:

    $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN,
    OAUTH_SECRET);
    
    评论

报告相同问题?