]> projects.mako.cc - twitter-api-cdsw/blob - twitter3.py
897b7b322c7d484b5ea301ebf32eacd2b22d9ba8
[twitter-api-cdsw] / twitter3.py
1 import tweepy
2 from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
3
4 auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
5 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
6
7 api = tweepy.API(auth)
8
9 public_tweets = api.search("data science", count=20)
10
11 for tweet in public_tweets:
12     print tweet.user.screen_name + "\t" + str(tweet.created_at) + "\t" + tweet.text

Benjamin Mako Hill || Want to submit a patch?