【问题标题】:Twitter Search API – since_id and max_idTwitter 搜索 API – since_id 和 max_id
【发布时间】:2015-04-28 02:47:16
【问题描述】:

当我想使用 Twitter 的 search API 时,我应该如何计算 since_idmax_id? 我想从今天 00:00:00 到今天 23:59:59 收集大量数据。所以我读到我必须使用max_idsince_id,因为分页不再存在。我将如何在公共/全球搜索功能中使用它?

我想收集今天的所有条带有特定主题标签的推文。我该怎么办?

【问题讨论】:

    标签: node.js twitter


    【解决方案1】:

    您可以使用 twitter 搜索 API 执行此操作。您的论点将具有以下结构:

    #yourtag since:2015-04-27 until:2015-04-28
    

    如果您使用的是 npm 模块:

    client.get('search/tweets', {q: '#yourtag since:2015-04-27 until:2015-04-28'}, function(error, tweets, response){
       console.log(tweets);
    });
    

    https://dev.twitter.com/rest/public/search

    【讨论】:

    • 好的,我有。然后我有下一点:有数百万个结果,因为我没有加载时间线。我考虑过使用result_type = recent,因为它只会获取最新推文的 ID。在不达到速率限制的情况下,我该如何做呢?
    • 数以百万计的结果?如果您的用例超过了 twitter 的免费 API 速率限制,您可能需要考虑更多分析风格的服务,例如 gnip.com
    猜你喜欢
    • 1970-01-01
    • 2016-04-29
    • 2012-03-31
    • 2015-12-07
    • 1970-01-01
    • 2011-09-18
    • 2013-03-21
    • 1970-01-01
    • 2010-12-28
    相关资源
    最近更新 更多