projects
/
twitter-api-cdsw-solutions
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated packages and code to python3. Won't work with python 2
[twitter-api-cdsw-solutions]
/
twitter-stream1.py
diff --git
a/twitter-stream1.py
b/twitter-stream1.py
index 06f7be07d3046b523e9ff79b789aef17cfacbb00..87c548c0093d61c9435b0957f5a54f7307a3fe27 100644
(file)
--- a/
twitter-stream1.py
+++ b/
twitter-stream1.py
@@
-8,10
+8,10
@@
api = tweepy.API(auth)
class StreamListener(tweepy.StreamListener):
def on_status(self, tweet):
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):
def on_error(self, status_code):
- print
'Error: ' + repr(status_code
)
+ print
('Error: ' + repr(status_code)
)
return False
l = StreamListener()
return False
l = StreamListener()
Benjamin Mako Hill
||
Want to submit a patch?