From 9a959513bef959ea319199826e75ebb83c8ea44d Mon Sep 17 00:00:00 2001 From: kjwon15 Date: Mon, 11 Aug 2014 02:56:21 +0900 Subject: [PATCH] Handling message "friends" on streaming. --- tweepy/streaming.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.25.1