Tweepy:现在可以通过Twitter搜索API获得旧的推文了吗? [英] Tweepy: get old tweets now possible with Twitter search api?

查看:1441
本文介绍了Tweepy:现在可以通过Twitter搜索API获得旧的推文了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 http://www.theverge.com/2014/11/18/7242477/twitter-search-now-lets-you-find-any-tweet-ever-sent Twitter搜索现在可以让您查找曾经发送过的任何推文.

Accoring to http://www.theverge.com/2014/11/18/7242477/twitter-search-now-lets-you-find-any-tweet-ever-sent Twitter search now lets you find any tweet ever sent.

但是当我尝试使用tweepy获取2014年至2015年的推文时,它只是最近的一次:

But when i am trying to get tweets from 2014 to 2015 using tweepy it gets only recent:

    query = 'Nivea'
    max_tweets = 1000
    searched_tweets = [json.loads(status.json) for status in tweepy.Cursor(api.search,
                                                                           q=query,
                                                                           count=100,
                                                                           #since_id="24012619984051000",
                                                                           since="2014-02-01",
                                                                           until="2015-02-01",
                                                                           result_type="mixed",
                                                                           lang="en"
                                                                           ).items(max_tweets)]

我尝试了since ="2014-02-01"和since_id,但没关系.

I tried since="2014-02-01", and since_id but no matter.

推荐答案

不幸的是,您无法从Twitter访问过去的数据.不管您使用的是哪个库,这都不是问题:Tweepy,Twitter4J或其他任何东西,仅仅是Twitter不会提供任何早于或少于2周的数据.

Unfortunately, you cannot access past data from Twitter. Is not a problem of what library you're using: Tweepy, Twitter4J, whatever, is just that Twitter won't provide any data that is older than more or less 2 weeks.

要获取历史数据,您需要直接通过Twitter或GNIP等第三方经销商访问firehose.

To get historical data you'll need access to firehose, directly through Twitter or third-party resellers like GNIP.

这篇关于Tweepy:现在可以通过Twitter搜索API获得旧的推文了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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