Python Twitter search.tweets with until

标签 python twitter python-twitter

我正在使用来自 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/

相关文章:

python - 如何清除我的缓存?

jquery - Bootstrap Carousel - 改变循环方向

facebook - ASP 经典 : twitter and facebook autoposting without signing in

python - Python 中的 Twitter 时间线,但只得到 20 左右的结果?

Python Subprocess call() 不执行shell命令

python - Altair 条件颜色散点图

python - Flask 返回 404 触发异常 block 并且不返回 Not Found

r - 通过 twitterR-package 获取推文计数

python - 使用 Twitter API 更改密码