超过一周的推文的Python twitter抓取工具?

时间:2012-02-05 02:44:20

标签: twitter web-crawler

对于学术用途,我想分析大约三个月的推文。但是,似乎official Twitter search API不提供超过一周的推文。

我尝试编写自我抓取工具,但是,如果使用搜索关键字,Twitter页面将不会显示超过一周的推文。

有什么技巧可以让我发现更旧的推文吗?或者我最好的选择是每周打一次API并在接下来的三个月内完成它?

1 个答案:

答案 0 :(得分:2)

来自Twitter API documentation关于限制:

 - The Search API is not complete index of all Tweets, but instead an index of recent Tweets. 
 - At the moment that index includes between 6-9 days of Tweets.
 - You cannot use the Search API to find Tweets older than about a week.

所以,是的,如果您需要收集一定的时间,则需要多次查询,如您所建议的那样。

(你也应该阅读这个答案:retrieving tweets from specific user older than 7 days

目前还有两家商业公司可以访问Twitter firehose并可以提供这些数据(他们被称为“授权重新联合发布者”):

  • Gnip - 提供30天的Twitter数据
  • DataSift - 长达两年的Twitter数据