Created
August 3, 2012 19:42
-
-
Save jzazove/3250798 to your computer and use it in GitHub Desktop.
Tip or Skip OAuth Python Snippet
This file contains 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
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