Changed how replies works in TWBlue

This commit is contained in:
2016-12-09 10:15:39 -06:00
parent ca0f00e27d
commit 1351712db4
5 changed files with 117 additions and 49 deletions

View File

@@ -66,14 +66,14 @@ def is_geocoded(tweet):
if tweet.has_key("coordinates") and tweet["coordinates"] != None:
return True
def get_all_mentioned(tweet, conf):
def get_all_mentioned(tweet, conf, field="screen_name"):
""" Gets all users that has been mentioned."""
string = []
results = []
for i in tweet["entities"]["user_mentions"]:
if i["screen_name"] != conf["user_name"] and i["screen_name"] != tweet["user"]["screen_name"]:
if i["id"] not in string:
string.append(i["id_str"])
return " ".join(string)+" "
if i[field] not in results:
results.append(i[field])
return results
def get_all_users(tweet, conf):
string = []