]> projects.mako.cc - twitter-api-cdsw/blobdiff - twitter-stream1.py
change variable name to make it more clear
[twitter-api-cdsw] / twitter-stream1.py
index 06f7be07d3046b523e9ff79b789aef17cfacbb00..e94422dd0f8dc43b3c99258755aa429cea3a17a6 100644 (file)
@@ -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()

Benjamin Mako Hill || Want to submit a patch?