开发者

Getting Twitter home timeline tweets

I am using Twitters REST api for the first time and I am a little confused by their documentation. I want to poll their API every ten minutes (to avoid the rate limits), retrieve t开发者_JAVA技巧he previous ten minutes of tweets and then do some processing on them.

I am using "GET statuses/home_timeline" to do this. The first part of the documentation says it will return the most recent 20 tweets but then says it will return up to 800 and then later on says it will return 200.

Could someone advise me on the correct method to use?

Thanks

EDIT: Documentation link: http://dev.twitter.com/doc/get/statuses/home_timeline


To get the home timeline (assuming you've already authenticated), you will have to GETthe Home Timeline like follows:

For XML:

http://api.twitter.com/1/statuses/home_timeline.xml

For JSON:

http://api.twitter.com/1/statuses/home_timeline.json

For RSS:

http://api.twitter.com/1/statuses/home_timeline.rss

For ATOM:

http://api.twitter.com/1/statuses/home_timeline.atom

It will return the latest 20 timelines (if no count attribute is passed), but it's maximum return statuses is limited to 800, if retweets are included.

The count attribute only allows you to pull more than 20 (default) statuses but you can request up to 200 maximum statuses (since Twitter has to include retweets).

Does that make sense?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜