我试图收集有关自然灾害的微博,只是为了我的学术目的。但似乎我不能得到超过一周的微博。在
我试过tweepy,python twitter,twython。在
有没有什么可以让我收集更多的微博?在
我的代码
from twython import Twython
import json
app_key=""
app_secret=""
oauth_token=""
ouath_token_secret=""
twitter = Twython(app_key,app_secret,oauth_token,ouath_token_secret)
data=twitter.search(q='MumbaiRains',result_type='Mixed',count=100)
statuses = data['statuses']
for post in statuses:
print(post['id_str']+':'+post['text'])
我能得到80条记录,因为在过去的7天里只有80条微博。在
如果我打印数据['search_metadata'],我将得到
{u'count': 100, u'completed_in': 0.053, u'max_id_str': u'939389383920164864', u'since_id_str': u'0', u'refresh_url': u'?since_id=939389383920164864&q=MumbaiRains&result_type=Mixed&include_entities=1', u'since_id': 0, u'query': u'MumbaiRains', u'max_id': 939389383920164864}
Twitter的standard Search API只提供对过去7天的tweet的访问。有付费和企业付费选项可以访问30天的tweet,除此之外还有一个企业完整存档搜索选项。使用标准的免费访问,您将被限制在7天的数据。在
相关问题 更多 >
编程相关推荐