【问题标题】:Python twitter crawler for tweets older than one week?超过一周的推文的 Python 推特爬虫?
【发布时间】:2012-02-27 03:00:34
【问题描述】:

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

我尝试编写一个自我爬虫,但是,给定搜索关键字,Twitter 页面将不会显示超过一周的推文。

有什么技巧可以让我获得较旧的推文吗?或者我最好的办法是每周访问一次 API,并在接下来的三个月内完成?

【问题讨论】:

  • 时长真的很重要,还是您只是想获得一定数量的推文?
  • @kmote 卷相对容易。我关心的是持续时间。
  • 可以爬取Twitter Search的搜索结果。有些推文超过一周或更长时间。

标签: twitter web-crawler


【解决方案1】:

来自 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 数据

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-23
    • 1970-01-01
    • 1970-01-01
    • 2015-02-21
    • 1970-01-01
    • 2014-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多