From 7d7ccdbd5a011aea0ae85ebc019486db364925d4 Mon Sep 17 00:00:00 2001 From: Simon Hewitt Date: Wed, 17 May 2017 14:46:10 -0700 Subject: [PATCH] handle scrub_geo, status_withheld and user_withheld streaming events --- tweepy/streaming.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 82a7ac2..f56617a 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -78,6 +78,15 @@ class StreamListener(object): elif 'warning' in data: if self.on_warning(data['warning']) is False: return False + elif 'scrub_geo' in data: + if self.on_scrub_geo(data['scrub_geo']) is False: + return False + elif 'status_withheld' in data: + if self.on_status_withheld(data['status_withheld']) is False: + return False + elif 'user_withheld' in data: + if self.on_user_withheld(data['user_withheld']) is False: + return False else: logging.error("Unknown message type: " + str(raw_data)) @@ -136,6 +145,17 @@ class StreamListener(object): """Called when a disconnection warning message arrives""" return + def on_scrub_geo(self, notice): + """Called when a location deletion notice arrives""" + return + + def on_status_withheld(self, notice): + """Called when a status withheld content notice arrives""" + return + + def on_user_withheld(self, notice): + """Called when a user withheld content notice arrives""" + return class ReadBuffer(object): """Buffer data from the response in a smarter way than httplib/requests can. -- 2.25.1