From b87ad04e5f55dba3cbbeacea60e56e502c916ec2 Mon Sep 17 00:00:00 2001 From: Kamil Kiwior Date: Wed, 23 Apr 2025 19:02:23 +0200 Subject: [PATCH] add replyingToID field in api response --- vxApi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vxApi.py b/vxApi.py index f668505..b445ead 100644 --- a/vxApi.py +++ b/vxApi.py @@ -219,6 +219,10 @@ def getApiResponse(tweet,include_txt=False,include_rtf=False): if 'in_reply_to_screen_name' in tweetL and tweetL['in_reply_to_screen_name'] != None: replyingTo = tweetL['in_reply_to_screen_name'] + replyingToID = None + if 'in_reply_to_status_id_str' in tweetL andTweetL['in_reply_to_status_id_str'] != None: + replyingToID = tweetL['in_reply_to_status_id_str'] + apiObject = { "text": twText, "likes": tweetL["favorite_count"], @@ -244,10 +248,11 @@ def getApiResponse(tweet,include_txt=False,include_rtf=False): "article": tweetArticle, "lang": lang, "replyingTo": replyingTo, + "replyingToID": replyingToID, } try: apiObject["date_epoch"] = int(datetime.strptime(tweetL["created_at"], "%a %b %d %H:%M:%S %z %Y").timestamp()) except: pass - return apiObject \ No newline at end of file + return apiObject