From: kjwon15 Date: Sun, 10 Aug 2014 17:56:21 +0000 (+0900) Subject: Handling message "friends" on streaming. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9a959513bef959ea319199826e75ebb83c8ea44d;p=tweepy.git Handling message "friends" on streaming. --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 4d6c4fa..a444e27 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -58,6 +58,9 @@ class StreamListener(object): status = Status.parse(self.api, data) if self.on_direct_message(status) is False: return False + elif 'friends' in data: + if self.on_friends(data['friends']) is False: + return False elif 'limit' in data: if self.on_limit(data['limit']['track']) is False: return False @@ -87,6 +90,13 @@ class StreamListener(object): """Called when a new direct message arrives""" return + def on_friends(self, friends): + """Called when a friends list arrives. + + friends is a list that contains user_id + """ + return + def on_limit(self, track): """Called when a limitation notice arrvies""" return