I'm trying to limit by stream to a specific user or set of users. I'm entering the user IDs like so:
streamer = tweepy.streaming.Stream(auth, Listener(), timeout=60)
streamer.filter(follow=[523460971,23595586], track=["traffic"])
But my stream shows all tweets with "traffic", regardless of the user.
Here's my full code:
class Listener(tweepy.StreamListener):
def on_status(self, status):
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...'
try:
streamer = tweepy.streaming.Stream(auth, Listener(), timeout=60)
streamer.filter(follow=[523460971,23595586], track=["traffic"])
except KeyboardInterrupt:
print "\nGoodbye..."
exit
Any help would be greatly appreciated.
Thanks!
Aaron