Compare commits
No commits in common. "master" and "1.0.0-b58" have entirely different histories.
@ -40,7 +40,7 @@ def sendToArtemis(syncId, pos, neu, neg, compound, type):
|
||||
strippedTimestamp = timestamp.replace(minute=0, second=0, microsecond=0)
|
||||
timestamp = strippedTimestamp.strftime('%Y-%m-%dT%H:%M:%S')
|
||||
|
||||
message = { "timestamp" : timestamp, "syncId": str(syncId), "pos" : pos, "neu" : neu, "neg" : neg, "compound" : compound, "type": type }
|
||||
message = { "timestamp" : timestamp, "syncId": syncId, "pos" : pos, "neu" : neu, "neg" : neg, "compound" : compound, "type": type }
|
||||
|
||||
messageJson = json.dumps(message, indent = 4)
|
||||
|
||||
@ -224,7 +224,6 @@ def collectorMain(hashtag):
|
||||
for i in range(len(hashtag)):
|
||||
Thread(target=collector, args=[hashtag[i]]).start()
|
||||
|
||||
sleep(2)
|
||||
createHourJob()
|
||||
|
||||
while True:
|
||||
|
||||
@ -10,13 +10,10 @@ class keys():
|
||||
self.sentiment_analyser_uri = os.getenv("SENTIMENT_URL")
|
||||
|
||||
def callSentimentAnalyser(tweet, syncId):
|
||||
headers = {
|
||||
"content-type":"text",
|
||||
"X-CRYPTO-Sync-ID" : str(syncId)
|
||||
}
|
||||
# log("Calling Sentiment Analyser for [{}]".format(tweet), 'INFO')
|
||||
try:
|
||||
uri = keys().sentiment_analyser_uri + "/sentiment?tweet="+tweet
|
||||
response = requests.request("GET", url=uri, headers=headers)
|
||||
response = requests.get(uri, headers={"X-CRYPTO-Sync-ID" : syncId})
|
||||
|
||||
response = json.loads(response.text)
|
||||
|
||||
@ -24,5 +21,5 @@ def callSentimentAnalyser(tweet, syncId):
|
||||
|
||||
return scores["pos"], scores["neu"], scores["neg"], scores["compound"]
|
||||
except:
|
||||
log("Could not call Sentiment Analyser Service with syncId of [{}]".format(syncId), 'ERR', syncId)
|
||||
log("Could not call Sentiment Analyser Service", 'ERR')
|
||||
return 0, 0, 0, 0
|
||||
@ -10,17 +10,15 @@ class keys():
|
||||
self.spamFilter_uri = os.getenv("FILTER_URL")
|
||||
|
||||
def callSpamFilter(tweet, syncId):
|
||||
headers = {
|
||||
"content-type":"text",
|
||||
"X-CRYPTO-Sync-ID" : str(syncId)
|
||||
}
|
||||
try:
|
||||
uri = keys().spamFilter_uri + "/predict?tweet="+tweet
|
||||
response = requests.request("GET", url=uri, headers=headers)
|
||||
response = requests.get(uri, headers={"X-CRYPTO-Sync-ID" : syncId})
|
||||
|
||||
response = json.loads(response.text)
|
||||
|
||||
# log("Spam Filter result for [{}] is [{}]".format(tweet, response["result"]), 'INFO')
|
||||
|
||||
return response["result"]
|
||||
except:
|
||||
log("Could not call spam filter service with syncId of [{}]".format(syncId), 'ERR', syncId)
|
||||
log("Could not call spam filter service", 'ERR')
|
||||
return ""
|
||||
Loading…
x
Reference in New Issue
Block a user