Skip to content

Instantly share code, notes, and snippets.

Jacob Petrie jaakko-sf

Block or report user

Report or block jaakko-sf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jaakko-sf
jaakko-sf / gen_bearer_token.py
Created Jul 16, 2016
Script to generate Twitter App-Only OAuth 2 bearer token
View gen_bearer_token.py
import base64
import requests
consumer_key = 'CONSUMER_KEY'
consumer_secret = 'CONSUMER_SECRET'
# get bearer token for application only requests
bearer_token_credentials = base64.urlsafe_b64encode(
'{}:{}'.format(consumer_key, consumer_secret).encode('ascii')).decode('ascii')
url = 'https://api.twitter.com/oauth2/token'
You can’t perform that action at this time.