Skip to content

Instantly share code, notes, and snippets.

@jzazove
Created August 3, 2012 19:42
Show Gist options
  • Save jzazove/3250798 to your computer and use it in GitHub Desktop.
Save jzazove/3250798 to your computer and use it in GitHub Desktop.
Tip or Skip OAuth Python Snippet
REQUEST_TOKEN_URL = 'https://tips.by/oauth/request_token'
ACCESS_TOKEN_URL = 'https://tips.by/oauth/access_token'
AUTHORIZATION_URL = 'https://tips.by/oauth/authorize'
CALLBACK_URL = '<your_encoded_callback_url>'
RESOURCE_URL = 'https://tips.by/api/1.0/product/5018324b18771ae13b000008/tip'
CONSUMER_KEY = '<consumer_key>'
CONSUMER_SECRET = '<consumer_secret>'
consumer = oauth.Consumer(key=CONSUMER_KEY, secret=CONSUMER_SECRET)
# Create our client.
client = oauth.Client(consumer)
# The OAuth Client request works just like httplib2 for the most part.
resp, content = client.request(REQUEST_TOKEN_URL, "GET")
print resp
print content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment