Commit 17cdae7f authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Add an oauth example script.

parent a079bf3a
import webbrowser
import tweepy
Query the user for their consumer key/secret
then attempt to fetch a valid access token.
if __name__ == "__main__":
consumer_key = raw_input('Consumer key: ').strip()
consumer_secret = raw_input('Consumer secret: ').strip()
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
# Open authorization URL in browser
# Ask user for verifier pin
pin = raw_input('Verification pin number from ').strip()
# Get access token
token = auth.get_access_token(verifier=pin)
# Give user the access token
print 'Access token:'
print ' Key: %s' % token.key
print ' Secret: %s' % token.secret
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment