Created
February 28, 2017 04:46
-
-
Save eldon/7fa31d5f1a3680b8e5843b69a5388b62 to your computer and use it in GitHub Desktop.
Twitter Application-only authentication token retriever
This file contains hidden or 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 requests | |
| CONSUMER_KEY = 'your key goes here' | |
| CONSUMER_SECRET = 'your secret goes here' | |
| r = requests.post('https://api.twitter.com/oauth2/token', auth=(CONSUMER_KEY, CONSUMER_SECRET), data={'grant_type': 'client_credentials'}) | |
| print r.json() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because the documentation out there makes it sound really complicated for no reason