Created
November 6, 2010 00:02
-
-
Save markpasc/665052 to your computer and use it in GitHub Desktop.
less interactive authorization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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