Add user_profile_image_url (#170) and communityNote fields to API
This commit is contained in:
parent
7cdd94aba2
commit
5be4741eff
@ -165,6 +165,12 @@ def twitfix(sub_path):
|
|||||||
media=[]
|
media=[]
|
||||||
media_extended=[]
|
media_extended=[]
|
||||||
hashtags=[]
|
hashtags=[]
|
||||||
|
communityNote=None
|
||||||
|
try:
|
||||||
|
if "birdwatch_pivot" in tweet:
|
||||||
|
communityNote=tweet["birdwatch_pivot"]["note"]["summary"]["text"]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if "extended_entities" in tweetL:
|
if "extended_entities" in tweetL:
|
||||||
if "media" in tweetL["extended_entities"]:
|
if "media" in tweetL["extended_entities"]:
|
||||||
tmedia=tweetL["extended_entities"]["media"]
|
tmedia=tweetL["extended_entities"]["media"]
|
||||||
@ -246,6 +252,7 @@ def twitfix(sub_path):
|
|||||||
"date": tweetL["created_at"],
|
"date": tweetL["created_at"],
|
||||||
"user_screen_name": html.unescape(userL["screen_name"]),
|
"user_screen_name": html.unescape(userL["screen_name"]),
|
||||||
"user_name": userL["name"],
|
"user_name": userL["name"],
|
||||||
|
"user_profile_image_url": userL["profile_image_url_https"],
|
||||||
"tweetURL": "https://twitter.com/"+userL["screen_name"]+"/status/"+tweet["rest_id"],
|
"tweetURL": "https://twitter.com/"+userL["screen_name"]+"/status/"+tweet["rest_id"],
|
||||||
"tweetID": tweet["rest_id"],
|
"tweetID": tweet["rest_id"],
|
||||||
"conversationID": tweetL["conversation_id_str"],
|
"conversationID": tweetL["conversation_id_str"],
|
||||||
@ -254,6 +261,7 @@ def twitfix(sub_path):
|
|||||||
"possibly_sensitive": tweetL["possibly_sensitive"],
|
"possibly_sensitive": tweetL["possibly_sensitive"],
|
||||||
"hashtags": hashtags,
|
"hashtags": hashtags,
|
||||||
"qrtURL": qrtURL,
|
"qrtURL": qrtURL,
|
||||||
|
"communityNote": communityNote
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
apiObject["date_epoch"] = int(datetime.strptime(tweetL["created_at"], "%a %b %d %H:%M:%S %z %Y").timestamp())
|
apiObject["date_epoch"] = int(datetime.strptime(tweetL["created_at"], "%a %b %d %H:%M:%S %z %Y").timestamp())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user