]> projects.mako.cc - twitter-api-cdsw/blobdiff - twitter-stream1.py
Updated packages and code to python3. Won't work with python 2
[twitter-api-cdsw] / twitter-stream1.py
index 06f7be07d3046b523e9ff79b789aef17cfacbb00..87c548c0093d61c9435b0957f5a54f7307a3fe27 100644 (file)
@@ -8,10 +8,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?