X-Git-Url: https://projects.mako.cc/source/twitter-api-cdsw-solutions/blobdiff_plain/30dd074a58c070a2ac07650a5eef9c13c3e773a9..369b91261f6d96b715f8ae0c14e6e6cab2996a34:/twitter-stream1.py diff --git a/twitter-stream1.py b/twitter-stream1.py index 06f7be0..e94422d 100644 --- a/twitter-stream1.py +++ b/twitter-stream1.py @@ -1,3 +1,4 @@ +import encoding_fix import tweepy from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET @@ -8,10 +9,10 @@ api = tweepy.API(auth) class StreamListener(tweepy.StreamListener): def on_status(self, tweet): - print tweet.user.screen_name + "\t" + tweet.text + print(tweet.author.screen_name + "\t" + tweet.text) def on_error(self, status_code): - print 'Error: ' + repr(status_code) + print('Error: ' + repr(status_code)) return False l = StreamListener()