diff --git a/main.py b/main.py index 3ec9fd4..5c93518 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import tweepy @@ -20,5 +20,5 @@ if __name__ == '__main__': while True: stream = tweepy.Stream(auth = api.auth, listener=RetweetingStreamListener(api)) stream.filter(track=['#zaunei2016', '@zaunei2016']) - print "[Error] Something went wrong reconnecting" + print("[Error] Something went wrong reconnecting") sleep(10.0) diff --git a/retweetingstreamlistener.py b/retweetingstreamlistener.py index 25a00d2..3c23ddf 100644 --- a/retweetingstreamlistener.py +++ b/retweetingstreamlistener.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import tweepy @@ -8,21 +8,21 @@ class RetweetingStreamListener(tweepy.StreamListener): def on_status(self, status): - print "[Info] %s - %s" % (status.user.screen_name, status.text) + print("[Info] %s - %s" % (status.user.screen_name, status.text)) if not hasattr(status, 'retweeted_status'): status.retweet() - print "[Info] Retweeted!" + print("[Info] Retweeted!") - print "-----------------------------------------" + print("-----------------------------------------") def on_error(self, status_code): # Rate limiting if status_code == 420: - print "[Error] Got Error 420, rate limiting in effect" + print("[Error] Got Error 420, rate limiting in effect") #returning False in on_data disconnects the stream return False - print "[Error] Got status code %d" % status_code + print("[Error] Got status code %d" % status_code) diff --git a/tokens_example.py b/tokens_example.py index f8dee0d..8f5b676 100644 --- a/tokens_example.py +++ b/tokens_example.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*-