根据http://www.theverge.com/2014/11/18/7242477/twitter-search-now-lets-you-find-any-tweet-ever-sent http://www.theverge.com/2014/11/18/7242477/twitter-search-now-lets-you-find-any-tweet-ever-sentTwitter 搜索现在可以让您找到曾经发送过的任何推文。
但是当我尝试使用 tweepy 获取 2014 年到 2015 年的推文时,它只获取最近的推文:
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,但没关系。
不幸的是,您无法从 Twitter 访问过去的数据。不是你使用什么库的问题:Tweepy、Twitter4J 等等,只是 Twitter 不会提供任何超过或少于 2 周的数据。
要获取历史数据,您需要直接通过 Twitter 或 GNIP 等第三方经销商访问 firehose。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)