我正在使用来自 https://github.com/sixohsix/twitter 的 Python Twitter 搜索 api
当我尝试使用“until”参数搜索查询时,搜索没有返回任何内容
from twitter import *
t = Twitter(auth=OAuth(....))
t.search.tweets(q = 'hello', count=3, until='2012-01-01')
{u'search_metadata': {u'count': 3, u'completed_in': 0.007, u'max_id_str': u'9223372036854775807', u'since_id_str': u'0', u'refresh_url': u'?since_id=9223372036854775807&q=hello%20until%3A2012-01-01&include_entities=1', u'since_id': 0, u'query': u'hello+until%3A2012-01-01', u'max_id': 9223372036854775807L}, u'statuses': []}
当我搜索时不带“直到”,它会正常找到推文。当我尝试在 twitter.com/search 上手动搜索时
https://twitter.com/search?q=hello%20until%3A2012-01-01&src=typd
它也能正常找到推文。
有什么想法吗?
最佳答案
这都是关于 twitter api 搜索限制的。引自 docs :
You cannot use the Search API to find Tweets older than about a week
例如,尝试运行
print t.search.tweets(q='hello', count=3, until='2013-03-01')
你会看到结果。
另外,看看这个 answer .
关于Python Twitter search.tweets with until,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15197319/