Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
updated oauth tokens example
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinwhittle committed Oct 13, 2009
1 parent 6ee2080 commit 4eaa9a7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions examples/oauth_tokens.py
Expand Up @@ -89,7 +89,7 @@ def main():
while not cb:
cb = raw_input('Please enter callback url: ')
except getopt.error, msg:
print ('python basic.py')
print ('python oauth_tokens.py')
sys.exit(2)

# make public request for data oauth requests for profiles
Expand All @@ -103,20 +103,20 @@ def main():
except:
access_token=None
if access_token:
print 'You have an access token: %s' % str(access_token.to_string())
print 'You have an access token: %s' % str(access_token.to_string().strip())
else:
# get request token
print '* Obtain a request token ...'
request_token = oauthapp.get_request_token()
request_token = oauthapp.get_request_token(CALLBACK_URL)

# authorize the request token
print '\n* Authorize the request token ...'
print '\nAuthorization URL:\n%s' % oauthapp.get_authorization_url(request_token, CALLBACK_URL)
print '\nAuthorization URL:\n%s' % oauthapp.get_authorization_url(request_token)
verifier = raw_input('Please authorize the url above ^^^')

# now the token we get back is an access token
print '\n* Obtain an access token ...'
access_token = oauthapp.get_access_token(request_token)
access_token = oauthapp.get_access_token(request_token, verifier.strip())
print '\nkey: %s' % str(access_token.key)
print 'secret: %s' % str(access_token.secret)
print 'yahoo guid: %s' % str(access_token.yahoo_guid)
Expand All @@ -132,6 +132,5 @@ def main():
pprint.PrettyPrinter(indent=2).pprint(oauthapp.getProfile())



if __name__ == '__main__':
main()

0 comments on commit 4eaa9a7

Please sign in to comment.