Added basic support for filter_level parameter for the streaming API
authorjohn <john@m.urray.com>
Mon, 1 Jun 2015 02:46:30 +0000 (19:46 -0700)
committerjohn <john@m.urray.com>
Mon, 1 Jun 2015 02:46:30 +0000 (19:46 -0700)
tweepy/streaming.py

index 6ce3e5c827b729a81eeed559c02db1810d685768..0d7f74298579c7a0c43faeb270699078e31924a6 100644 (file)
@@ -404,7 +404,7 @@ class Stream(object):
         self._start(async)
 
     def filter(self, follow=None, track=None, async=False, locations=None,
-               stall_warnings=False, languages=None, encoding='utf8'):
+               stall_warnings=False, languages=None, encoding='utf8', filter_level=None):
         self.body = {}
         self.session.headers['Content-type'] = "application/x-www-form-urlencoded"
         if self.running:
@@ -423,6 +423,8 @@ class Stream(object):
             self.body['stall_warnings'] = stall_warnings
         if languages:
             self.body['language'] = u','.join(map(str, languages))
+        if filter_level:
+            self.body['filter_level'] = filter_level
         self.session.params = {'delimited': 'length'}
         self.host = 'stream.twitter.com'
         self._start(async)