X-Git-Url: https://projects.mako.cc/source/twitter-api-cdsw/blobdiff_plain/5f84907a072eb4dd4b58dce2634f24ede6181eb8..HEAD:/twitter-stream-raw1.py?ds=inline diff --git a/twitter-stream-raw1.py b/twitter-stream-raw1.py index 734a59f..b6ea13b 100644 --- a/twitter-stream-raw1.py +++ b/twitter-stream-raw1.py @@ -1,3 +1,4 @@ +import encoding_fix import json import tweepy from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET @@ -5,7 +6,7 @@ from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) -api = tweepy.API(auth, parser=tweepy.parsers.RawParser) +api = tweepy.API(auth, parser=tweepy.parsers.RawParser()) @classmethod def parse(cls, api, raw): @@ -18,10 +19,10 @@ tweepy.models.Status.parse = parse class StreamListener(tweepy.StreamListener): def on_status(self, tweet): - print tweet.json + print(tweet.json) def on_error(self, status_code): - print 'Error: ' + repr(status_code) + print('Error: ' + repr(status_code)) return False l = StreamListener()