获取 Twitter 主页时间线推文 [英] Getting Twitter home timeline tweets

查看:43
本文介绍了获取 Twitter 主页时间线推文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次使用 Twitters REST api,我对他们的文档有点困惑.我想每十分钟轮询一次他们的 API(以避免速率限制),检索前十分钟的推文,然后对它们进行一些处理.

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 the previous ten minutes of tweets and then do some processing on them.

我正在使用GET statuses/home_timeline"来执行此操作.文档的第一部分说它将返回最近的 20 条推文,但随后说它将返回最多 800 条,然后又说它将返回 200 条.

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?

谢谢

文档链接:http://dev.twitter.com/doc/get/statuses/home_timeline

推荐答案

要获取主页时间线(假设您已经已经认证),您必须GET家庭时间轴如下:

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

对于 XML:

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

对于 JSON:

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

对于 RSS:

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

对于原子:

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

它将返回最近的 20 个时间线(如果没有传递 count 属性),但如果包含转推,它的最大返回状态限制为 800.

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.

count 属性只允许您提取超过 20 个(默认)状态,但您最多可以请求 200 个状态(因为 Twitter 必须包含转推).

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).

有意义吗?

这篇关于获取 Twitter 主页时间线推文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆