3

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': []}

「until」なしで検索すると、普通につぶやきが見つかります。twitter.com/search で手動で検索しようとすると

https://twitter.com/search?q=hello%20until%3A2012-01-01&src=typd

ツイートも正常に検索されます。

何か案は?

4

1 に答える 1

6

それはすべて、twitter api 検索の制限に関するものです。ドキュメントからの引用:

検索 API を使用して、約 1 週間以上前のツイートを検索することはできません

たとえば、実行してみてください

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

結果が表示されます。

また、こちらの回答もご覧ください。

于 2013-03-04T10:57:13.843 に答える