Skip to content

Instantly share code, notes, and snippets.

@WillisN
Last active September 30, 2020 02:25
Embed
What would you like to do?
twitter_secure
import json
import requests_oauthlib
def secure():
path = '.../secret/'
# Load Twitter API secrets from a json file
secrets = json.loads(open(path + 'secrets.json').read())
api_key = secrets['API_key']
api_secret_key = secrets['API_secret_key']
access_token = secrets['access_token']
access_token_secret = secrets['access_token_secret']
my_auth = requests_oauthlib.OAuth1(api_key, api_secret_key, access_token, access_token_secret)
return my_auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment