Created
July 29, 2020 00:37
-
-
Save kunwon1/8267e79ab29015ade439965fc03fa0f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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