Skip to content

Instantly share code, notes, and snippets.

@AnasAlmasri
Last active February 13, 2019 02:10
Show Gist options
  • Save AnasAlmasri/3b981668e544570dc2ddeb7ff5251b1b to your computer and use it in GitHub Desktop.
Save AnasAlmasri/3b981668e544570dc2ddeb7ff5251b1b to your computer and use it in GitHub Desktop.
Function to build Test data set based on a search term
def buildTestSet(search_keyword):
try:
tweets_fetched = twitter_api.GetSearch(search_keyword, count = 100)
print("Fetched " + str(len(tweets_fetched)) + " tweets for the term " + search_keyword)
return [{"text":status.text, "label":None} for status in tweets_fetched]
except:
print("Unfortunately, something went wrong..")
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment