Skip to content

Commit

Permalink
Fix community note in API
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpdx committed Sep 12, 2024
1 parent e31a5f1 commit 1d01a6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vxApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def getApiResponse(tweet,include_txt=False,include_rtf=False):
communityNote=None
try:
if "birdwatch_pivot" in tweet:
communityNote=tweet["birdwatch_pivot"]["note"]["summary"]["text"]
if 'summary' in tweet["birdwatch_pivot"]["note"]:
communityNote=tweet["birdwatch_pivot"]["note"]["summary"]["text"]
elif 'subtitle' in tweet["birdwatch_pivot"] and 'text' in tweet["birdwatch_pivot"]["subtitle"]:
communityNote=tweet["birdwatch_pivot"]["subtitle"]["text"]
except:
pass
if "extended_entities" in tweetL:
Expand Down

0 comments on commit 1d01a6c

Please sign in to comment.