mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-23 03:38:08 -06:00
Made get_all_mentioned to take into account sometimes tweets might have no entities defined
This commit is contained in:
parent
002e1ccb55
commit
4b60a79e49
@ -100,6 +100,7 @@ def is_media(tweet):
|
|||||||
def get_all_mentioned(tweet, conf, field="screen_name"):
|
def get_all_mentioned(tweet, conf, field="screen_name"):
|
||||||
""" Gets all users that have been mentioned."""
|
""" Gets all users that have been mentioned."""
|
||||||
results = []
|
results = []
|
||||||
|
if hasattr(tweet, "entities") and tweet.entities.get("user_mentions"):
|
||||||
for i in tweet.entities["user_mentions"]:
|
for i in tweet.entities["user_mentions"]:
|
||||||
if i["screen_name"] != conf["user_name"] and i["id_str"] != tweet.user:
|
if i["screen_name"] != conf["user_name"] and i["id_str"] != tweet.user:
|
||||||
if i.get(field) not in results:
|
if i.get(field) not in results:
|
||||||
|
Loading…
Reference in New Issue
Block a user