Skip to content

Instantly share code, notes, and snippets.

@eldon
Created February 28, 2017 04:46
Show Gist options
  • Select an option

  • Save eldon/7fa31d5f1a3680b8e5843b69a5388b62 to your computer and use it in GitHub Desktop.

Select an option

Save eldon/7fa31d5f1a3680b8e5843b69a5388b62 to your computer and use it in GitHub Desktop.
Twitter Application-only authentication token retriever
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()
@eldon
Copy link
Author

eldon commented Feb 28, 2017

Because the documentation out there makes it sound really complicated for no reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment