WIP old tweet version detection
This commit is contained in:
parent
1d01a6c067
commit
bf82e2e27e
14
vxApi.py
14
vxApi.py
@ -13,6 +13,8 @@ def getApiResponse(tweet,include_txt=False,include_rtf=False):
|
|||||||
media_extended=[]
|
media_extended=[]
|
||||||
hashtags=[]
|
hashtags=[]
|
||||||
communityNote=None
|
communityNote=None
|
||||||
|
oldTweetVersion = False
|
||||||
|
#editedTweet=False
|
||||||
try:
|
try:
|
||||||
if "birdwatch_pivot" in tweet:
|
if "birdwatch_pivot" in tweet:
|
||||||
if 'summary' in tweet["birdwatch_pivot"]["note"]:
|
if 'summary' in tweet["birdwatch_pivot"]["note"]:
|
||||||
@ -21,6 +23,18 @@ def getApiResponse(tweet,include_txt=False,include_rtf=False):
|
|||||||
communityNote=tweet["birdwatch_pivot"]["subtitle"]["text"]
|
communityNote=tweet["birdwatch_pivot"]["subtitle"]["text"]
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
if "edit_control" in tweet and "edit_tweet_ids" in tweet["edit_control"]:
|
||||||
|
#if len(tweet["edit_control"]['initial_tweet_id']) > 1:
|
||||||
|
# editedTweet = True
|
||||||
|
lastEditID = tweet["edit_control"]["edit_tweet_ids"][-1]
|
||||||
|
if lastEditID != tweet["rest_id"]:
|
||||||
|
oldTweetVersion = True
|
||||||
|
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"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user