Совет, пожалуйста:)
Когда я использую этот скрипт:
class CustomStreamListener(tweepy.StreamListener):
def on_status(self, status):
# We'll simply print some values in a tab-delimited format
# suitable for capturing to a flat file but you could opt
# store them elsewhere, retweet select statuses, etc.
try:
print "%s\t%s\t%s\t%s" % (status.text,
status.author.screen_name,
status.created_at,
status.source,)
except Exception, e:
print >> sys.stderr, 'Encountered Exception:', e
pass
def on_error(self, status_code):
print >> sys.stderr, 'Encountered error with status code:', status_code
return True # Don't kill the stream
def on_timeout(self):
print >> sys.stderr, 'Timeout...'
return True # Don't kill the stream
# Create a streaming API and set a timeout value of 60 seconds.
streaming_api = tweepy.streaming.Stream(auth, CustomStreamListener(), timeout=60)
# Optionally filter the statuses you want to track by providing a list
# of users to "follow".
print >> sys.stderr, 'Filtering the public timeline for "%s"' % (' '.join(sys.argv[1:]),)
streaming_api.filter(follow=None, track=Q)
Произошла ошибка, подобная этой:
Traceback (most recent call last):
File "C:/Python26/test.py", line 65, in <module>
streaming_api = tweepy.streaming.Stream(auth, CustomStreamListener(), timeout=60)
TypeError: __init__() takes at least 4 non-keyword arguments (3 given)
Что мне делать тогда?