Using Python-Oauth2 To Access OAuth Protected Resources
4Most of the examples I found for python-oauth2 show how to use the library to request and approve tokens, but not how to use the access token to access a protected resource (ie. how to actually make a call to the service you’re trying to access). Here’s an example:
import oauth2 as oauth
consumer = oauth.Consumer('consumer-key-here','consumer-secret-here')
token = oauth.Token('access-key-here','access-key-secret-here')
client = oauth.Client(consumer, token)
response = client.request('http://someservice.com/api/something/')
And here’s how you make a POST call:
import urllib
response, content = myclient.request("http://someservice.com/api/something/", \
method="POST", body=urllib.urlencode({'name': 'value', 'another_name': 'another value'}) )
Manage your expenses via Email, SMS, iPhone, Twitter, Voice (Call and say your expense), IM (Yahoo, AIM, MSN), or Web.