Skip to content

Instantly share code, notes, and snippets.

@kunwon1
Created July 29, 2020 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunwon1/8267e79ab29015ade439965fc03fa0f7 to your computer and use it in GitHub Desktop.
Save kunwon1/8267e79ab29015ade439965fc03fa0f7 to your computer and use it in GitHub Desktop.
def get_text(data):
try:
text = data['extended_tweet']['full_text']
except:
try:
text = data['full_text']
except:
try:
text = data['text']
except:
text = 'ERROR GETTING TWEET TEXT'
return text
def get_retweet_text(data):
text = ''
try:
text += data['retweeted_status']['full_text']
except:
text += data['retweeted_status']['text']
return text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment