Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Tweepy to search for tweets with API 1.1

I've been trying to get tweepy to search for a sring without success for the past 3 hours. I keep getting replied it should use api 1.1. I thought that was implemented... because I can post with tweepy. What am I doing wrong?

#!/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
like image 450
user2740993 Avatar asked Sep 02 '13 20:09

user2740993


1 Answers

Upgrade your tweepy version:

pip install --upgrade tweepy

Or, install it directly from github:

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

FYI, tested your code using 2.1 version - it works.

like image 114
alecxe Avatar answered Sep 23 '22 09:09

alecxe