Skip to content

Instantly share code, notes, and snippets.

@WillisN
Last active September 30, 2020 02:25
Show Gist options
  • Save WillisN/41a39e9079a83402f43e31a5ce9080a5 to your computer and use it in GitHub Desktop.
Save WillisN/41a39e9079a83402f43e31a5ce9080a5 to your computer and use it in GitHub Desktop.
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