Skip to content

Instantly share code, notes, and snippets.

@markpasc
Created November 6, 2010 00:02
Show Gist options
  • Save markpasc/665052 to your computer and use it in GitHub Desktop.
Save markpasc/665052 to your computer and use it in GitHub Desktop.
less interactive authorization
from oauth.oauth import OAuthConsumer, OAuthToken
import typepad
consumer = OAuthConsumer('your consumer token', 'your consumer secret')
app = typepad.Application.get_by_id('your Application ID')
oauth_client = typepad.OAuthClient(consumer, None)
oauth_client.request_token_url = app.oauth_request_token_url
oauth_client.access_token_url = app.oauth_access_token_url
oauth_client.authorization_url = app.oauth_authorization_url
request_token = oauth_client.fetch_request_token(None)
print oauth_client.authorize_token()
# Go to the URL and get the verifier code.
access_token = oauth_client.fetch_access_token(verifier='your verifier code')
print "Key:", access_token.key
print "Secret:", access_token.secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment