Trying to use tweepy to get info from twitter but keep getting
TweepError: Failed to send request: (“bad handshake: Error([(‘SSL routines’, ‘ssl3_get_server_certificate’, ‘certificate verify failed’)],)”,)
It’s python 27 on windows –
import tweepy
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
#Variables that contains the user credentials to access Twitter API
access_token = "insert access token"
access_token_secret = "insert access_token_secret"
consumer_key = "insert consumer_key"
consumer_secret = "insert consumer_secret"
class StdOutListener(StreamListener):
def on_data(self, data):
print data
return True
def on_error(self, status):
print status
if __name__ == '__main__':
#This handles Twitter authetification and the connection to Twitter Streaming API
l = StdOutListener()
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
stream = Stream(auth, l)
#http://gettwitterid.com/
api = tweepy.API(auth)
test = api.lookup_users(user_ids=['insertuserid'])
for user in test:
print user.screen_name
print user.name