From 3ea6c7d1293772c540cd688a69cc2f0560138320 Mon Sep 17 00:00:00 2001 From: "g.minoccari" Date: Fri, 28 May 2021 16:02:03 +0200 Subject: [PATCH] Sostituite le stringhe con le consumer key e gli acces token con delle variabili d'ambiente --- nest_crawler/authentication.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nest_crawler/authentication.py b/nest_crawler/authentication.py index 4b369c2..e4b68d8 100644 --- a/nest_crawler/authentication.py +++ b/nest_crawler/authentication.py @@ -1,11 +1,12 @@ import tweepy as tw +import os def authenticate(): - c_k = "GEhtSyP9e98mzFeiOCSW0lvQX" - c_s = "438cmYrl5xqaX2W7I2Bf5A9nF1pN5VtM9f77WYQnAXg1BwKJ27" - a_t = "1380217745732689921-IW3U1JlxhnQeGBUrnHZ2nxbxhksXUZ" - a_t_s = "EUoYNoj72rb2q00tUIW8eTcLJAhUAYPstZlV78W9cPpEJ" + c_k = os.getenv('C_K') + c_s = os.getenv('C_S') + a_t = os.getenv('A_T') + a_t_s = os.getenv('A_T_S') auth = tw.OAuthHandler(c_k, c_s) auth.set_access_token(a_t, a_t_s)