[09.10.20] Connection testing

This commit is contained in:
andrewso 2020-10-09 19:49:13 +01:00
parent 139619bd79
commit 651bea1cd4
2 changed files with 3 additions and 3 deletions

View File

@ -10,13 +10,12 @@ class keys():
self.sentiment_analyser_uri = os.getenv("SENTIMENT_URL")
def callSentimentAnalyser(tweet):
log("Calling Sentiment Analyser", 'INFO')
log("Calling Sentiment Analyser for {}".format(tweet), 'INFO')
try:
uri = keys().sentiment_analyser_uri + "/sentiment?tweet="+tweet
response = requests.request("GET", uri)
response = json.loads(response.text)
print(response["result"]["Score"])
scores = response["result"]["Score"]

View File

@ -15,7 +15,8 @@ def callSpamFilter(tweet):
response = requests.request("GET", uri)
response = json.loads(response.text)
print(response["result"])
log("Spam Filter result for {} is {}".format(tweet, response["result"]), 'INFO')
return response["result"]
except: