使用Tweepy搜索API 1.1的推文

时间:2013-09-02 20:35:25

标签: python search twitter tweepy

在过去的3个小时里,我一直在努力寻找一个没有成功的sring。我一直在回复它应该使用api 1.1。我认为这是实施的......因为我可以用tweepy发帖。我做错了什么?

#!/usr/bin/env python

import tweepy

consumer_key = '***'
consumer_secret = '***'
access_token = '***'
access_token_secret = '***'

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)


results = api.search(q="Mice")

for result in results:
    print result.text

1 个答案:

答案 0 :(得分:6)

升级您的tweepy版本:

pip install --upgrade tweepy

或者,直接从github安装:

git clone https://github.com/tweepy/tweepy.git
cd tweepy
python setup.py install

仅供参考,使用2.1版本测试您的代码 - 它有效。

相关问题