Skip to content

Instantly share code, notes, and snippets.

@mertsalik
Created February 5, 2016 12:19
Show Gist options
  • Save mertsalik/2e0364c9857cf4e9572c to your computer and use it in GitHub Desktop.
Save mertsalik/2e0364c9857cf4e9572c to your computer and use it in GitHub Desktop.
__author__ = 'mertsalik'
CLIENT_ID = "03f40f65049e49b98de691b4cbe710da"
CLIENT_SECRET = "9dd8e1dc8cb54f3c84af8dd4a657f7f7"
REDIRECT_URI = "http://localhost"
TOKEN_URL = "https://api.instagram.com/oauth/authorize/?client_id={clientID}&redirect_uri={redirectURI}&response_type=code"
CURL_COMMAND = "curl -F 'client_id={clientID}' -F 'client_secret={clientSecret}' -F 'grant_type=authorization_code' -F 'redirect_uri={redirectURI}' -F 'code={code}' https://api.instagram.com/oauth/access_token"
if __name__ == "__main__":
url = TOKEN_URL.format(clientID=CLIENT_ID, redirectURI=REDIRECT_URI)
print url
code = raw_input("Enter the code:")
curl_command = CURL_COMMAND.format(clientID=CLIENT_ID, clientSecret=CLIENT_SECRET,redirectURI=REDIRECT_URI,code=code)
print curl_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment