[英]Using Tweepy to search for tweets with API 1.1
在過去的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
升級你的tweepy
版本:
pip install --upgrade tweepy
或者,直接從github安裝它:
git clone https://github.com/tweepy/tweepy.git
cd tweepy
python setup.py install
僅供參考,使用2.1
版本測試您的代碼 - 它的工作原理。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.