added support for count parameter in filter method
authorw43L <info@w43l.com>
Wed, 1 Dec 2010 02:22:35 +0000 (10:22 +0800)
committerJoshua Roesslein <jroesslein@gmail.com>
Thu, 13 Jan 2011 05:04:23 +0000 (13:04 +0800)
tweepy/streaming.py

index c65ae9e93c87dd1fd37447d2d9e0263ddf971ad5..5ac12db346b7b5bd38044f592414d547738ffb56 100644 (file)
@@ -191,7 +191,7 @@ class Stream(object):
             self.url += '&count=%s' % count
         self._start(async)
 
-    def filter(self, follow=None, track=None, async=False, locations=None):
+    def filter(self, follow=None, track=None, async=False, locations=None, count = None):
         self.parameters = {}
         self.headers['Content-type'] = "application/x-www-form-urlencoded"
         if self.running:
@@ -204,6 +204,8 @@ class Stream(object):
         if locations and len(locations) > 0:
             assert len(locations) % 4 == 0
             self.parameters['locations'] = ','.join(['%.2f' % l for l in locations])
+       if count:
+               self.parameters['count'] = count
         self.body = urllib.urlencode(self.parameters)
         self.parameters['delimited'] = 'length'
         self._start(async)