Setup OSX 10.7.4, Eclipse, Pydev, Python 2.7, Tweepy-1.9
Hey, I was originally trying to grab tweets from the twitter API but kept getting the same error as below. This program is designed to print the twitter API rate limit to make sure I am not gone over.
I keep getting this error but there is very little info online about it.
Any help is appreciated.
The Code
import tweepy
auth = tweepy.OAuthHandler(Consumer Key, Consumer Secret)
auth.set_access_token(Access token,Access token secret)
api = tweepy.API(auth)
print api.rate_limit_status()
#print tweepy.api.rate_limit_status()
The Error
Traceback (most recent call last):
File "/Users/brendan/Documents/workspace/Euro2012/src/rate_limit.py", line 7, in <module>
print api.rate_limit_status()
File "build/bdist.macosx-10.5-fat3/egg/tweepy/binder.py", line 185, in _call
File "build/bdist.macosx-10.5-fat3/egg/tweepy/binder.py", line 149, in execute
tweepy.error.TweepError: Failed to send request: [Errno 61] Connection refused
EDIT: I have no confirmation on this as yet but I suspect the problem is with proxy settings
For some reason, tweepy uses the low-level httplib instead of the high-level urllib2. httplib does not use HTTP proxies; it is used by other modules to implement HTTP proxy support.
Either get an internet connection that allows direct connections without proxy configuration, or modify tweepy to use urllib2, or use another library.