Skip to content

Instantly share code, notes, and snippets.

@talfco
Created February 4, 2019 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talfco/0932dfd45b19d5b4ece76c27eb86dbc2 to your computer and use it in GitHub Desktop.
Save talfco/0932dfd45b19d5b4ece76c27eb86dbc2 to your computer and use it in GitHub Desktop.
# attempt authentication
try:
# create OAuthHandler object
auth = OAuthHandler(consumer_key, consumer_secret)
# set access token and secret
auth.set_access_token(access_token, access_token_secret)
# create tweepy API object to fetch tweets
self.__api = tweepy.API(auth)
except:
print("Error: Authentication Failed")
exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment