3 from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
5 auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
6 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
10 # code to write the file
12 output_file = codecs.open("MY_DATA.tsv", "w", "utf-8")
14 public_tweets = api.search("data science", count=10)
16 for tweet in public_tweets:
17 print(tweet.user.screen_name + "\t" + str(tweet.created_at) + "\t" + tweet.text, file=output_file)