2013-03-04 26 views
3

我使用Python Twitter搜索API從https://github.com/sixohsix/twitter的Python的Twitter search.tweets用,直到

當我嘗試搜索使用「直到」參數,搜索不返回任何東西

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 

它也會正常發現推文。

任何想法?

回答

6

這是關於Twitter的API搜索限制。從docs報價:

不能使用搜索API來找到一個比一個星期左右的年齡較大的鳴叫

例如,嘗試運行

print t.search.tweets(q='hello', count=3, until='2013-03-01') 

,你會看到結果。

另外,請看看這個answer