From bf82e2e27ec6e685b2ebba0274cb2f5aaeed7556 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 12 Sep 2024 23:56:50 +0100 Subject: [PATCH] WIP old tweet version detection --- vxApi.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vxApi.py b/vxApi.py index 20f5163..40398ff 100644 --- a/vxApi.py +++ b/vxApi.py @@ -13,6 +13,8 @@ def getApiResponse(tweet,include_txt=False,include_rtf=False): media_extended=[] hashtags=[] communityNote=None + oldTweetVersion = False + #editedTweet=False try: if "birdwatch_pivot" in tweet: 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"] except: 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 "media" in tweetL["extended_entities"]: tmedia=tweetL["extended_entities"]["media"]