Skip to content

Instantly share code, notes, and snippets.

@torrez
Created September 24, 2010 23:59
Show Gist options
  • Save torrez/596261 to your computer and use it in GitHub Desktop.
Save torrez/596261 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import tweepy
import sys
import webbrowser
arguments = sys.argv[1:]
if len(arguments) < 2:
print "Missing consumer keys.\n"
sys.exit(2)
consumer_key = arguments[0]
consumer_secret = arguments[1]
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
print "Sending you to: "
auth_url = auth.get_authorization_url()
print auth_url
webbrowser.open(auth_url)
oauth_token = raw_input("What was the oauth_token you got back? (It was in the return URL): ")
auth.get_access_token(oauth_token)
print "Write these down:"
print "KEY: %s" % (auth.access_token.key)
print "SECRET: %s" % (auth.access_token.secret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment