From 714f96021597a4faa437eb2b245479bc029b253c Mon Sep 17 00:00:00 2001 From: Lucas Oskorep Date: Wed, 6 May 2020 13:16:00 -0500 Subject: [PATCH] Adding in .env loading of credentials --- collect_tweets.py | 4 ++-- twitter_credentials.py | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/collect_tweets.py b/collect_tweets.py index c52e5d0..797f8dd 100644 --- a/collect_tweets.py +++ b/collect_tweets.py @@ -7,8 +7,8 @@ from dotenv import load_dotenv load_dotenv() -consumer_key = os.getenv('CKEY', '0') -consumer_secret = os.getenv('CSECRET', '0') +consumer_key = os.getenv('APIKEY', '0') +consumer_secret = os.getenv('APISECRET', '0') access_token = os.getenv('ATOKEN', '0') access_token_secret = os.getenv('ASECRET', '0') diff --git a/twitter_credentials.py b/twitter_credentials.py index 2051e67..1bb10e9 100644 --- a/twitter_credentials.py +++ b/twitter_credentials.py @@ -1,5 +1,12 @@ -# Variables that contains the user credentials to access Twitter API -ACCESS_TOKEN = "" -ACCESS_TOKEN_SECRET = "" -CONSUMER_KEY = "" -CONSUMER_SECRET = "" +# Variables that contains the user credentials to access Twitter API +import os + +from dotenv import load_dotenv + +load_dotenv() + + +ACCESS_TOKEN = os.getenv('ATOKEN', '0') +ACCESS_TOKEN_SECRET = os.getenv('ASECRET', '0') +CONSUMER_KEY = os.getenv('APIKEY', '0') +CONSUMER_SECRET = os.getenv('APISECRET', '0')