Last active
September 30, 2020 02:25
-
-
Save WillisN/41a39e9079a83402f43e31a5ce9080a5 to your computer and use it in GitHub Desktop.
twitter_secure
This file contains 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 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