【问题标题】:Impossible to get results from last year in twitter API search在 twitter API 搜索中无法获得去年的结果
【发布时间】:2016-01-13 07:33:44
【问题描述】:

我是twitter API的新手,我尝试了一些非常简单的请求,似乎不可能得到去年的结果。我正在使用来自 Abraham Williams (https://github.com/abraham/twitteroauth) 的 TwitterOAuth 库。
这个请求给了我结果

$connection = new TwitterOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
$content = $connection->get("search/tweets", array('q'=>'from:RToVR until:2016-07-19'));

但是这个没有:

$connection = new TwitterOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
$content = $connection->get("search/tweets", array('q'=>'from:RToVR until:2015-07-19'));

有人知道为什么吗?谢谢!

【问题讨论】:

    标签: php twitter twitter-oauth


    【解决方案1】:

    是的,很简单的答案。 Twitter 搜索 API 文档 https://dev.twitter.com/rest/public/search 明确指出,您只能以编程方式检索大约 7 天前的数据,因为索引仅涵盖该时间段。

    【讨论】:

    • 哦,我没看到这条线,谢谢!那么还有其他方法可以通过网络检索较旧的推文吗?我想从 2015 年发布的用户那里获取所有图片,但不确定是否有可能......
    • 网络搜索页面可以让您这样做,但这是一个非常手动的过程,您必须对结果进行分页(不允许抓取)。 Twitter 的商业 GNIP 产品提供了完全支持的全存档搜索,但这并不是一个便宜的选择。
    • 好的,感谢您指出这一点。那么我会改变我的项目的行为,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-19
    • 1970-01-01
    • 2011-05-26
    • 1970-01-01
    • 2016-03-05
    • 2010-12-26
    • 1970-01-01
    相关资源
    最近更新 更多