Tweepy issue #205: Adding stall_warnings support to Stream.filter method.
authorinactivist <inactivist@gmail.com>
Wed, 5 Sep 2012 19:47:59 +0000 (12:47 -0700)
committerinactivist <inactivist@gmail.com>
Wed, 5 Sep 2012 19:47:59 +0000 (12:47 -0700)
tweepy/streaming.py

index ecc4847b33c513c22115483148c6a3af20709d7e..3e6910f8f706b61ad603fc0b8220c6df6c350675 100644 (file)
@@ -208,7 +208,8 @@ class Stream(object):
             self.url += '&count=%s' % count
         self._start(async)
 
-    def filter(self, follow=None, track=None, async=False, locations=None, count = None):
+    def filter(self, follow=None, track=None, async=False, locations=None, 
+        count = None, stall_warnings=False):
         self.parameters = {}
         self.headers['Content-type'] = "application/x-www-form-urlencoded"
         if self.running:
@@ -223,6 +224,8 @@ class Stream(object):
             self.parameters['locations'] = ','.join(['%.2f' % l for l in locations])
         if count:
             self.parameters['count'] = count
+        if stall_warnings:
+            self.parameters['stall_warnings'] = stall_warnings
         self.body = urlencode_noplus(self.parameters)
         self.parameters['delimited'] = 'length'
         self._start(async)