Created
January 16, 2015 14:40
-
-
Save sandes/6fce0a27c3456ef2dce4 to your computer and use it in GitHub Desktop.
Get access token instagram
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
import pycurl,urllib | |
try: | |
# python 3 | |
from urllib.parse import urlencode | |
except ImportError: | |
# python 2 | |
from urllib import urlencode | |
curl = pycurl.Curl() | |
curl.setopt(pycurl.URL,"https://api.instagram.com/oauth/access_token") | |
post_data = { 'client_id': '', | |
'client_secret': '', | |
'redirect_uri': '', | |
'code': '', | |
'grant_type': 'authorization_code' | |
} | |
post_fields = urllib.urlencode(post_data) | |
curl.setopt(pycurl.POST, True) | |
curl.setopt(pycurl.POSTFIELDS, post_fields) | |
curl.perform() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment