Added language parameter to streaming filter
authorRene Bruns <rene.bruns@wywy.com>
Wed, 27 Mar 2013 09:58:37 +0000 (10:58 +0100)
committerRene Bruns <rene.bruns@wywy.com>
Wed, 27 Mar 2013 09:58:37 +0000 (10:58 +0100)
(see: https://dev.twitter.com/blog/introducing-new-metadata-for-tweets)

tweepy/streaming.py

index ab97fbdec961ba853c75b7069f55e22ebe8a5b20..b1bb4b24002d7b33a85b5b9d27a3293b7c9d4dec 100644 (file)
@@ -208,7 +208,7 @@ class Stream(object):
         self._start(async)
 
     def filter(self, follow=None, track=None, async=False, locations=None, 
-        count = None, stall_warnings=False):
+        count = None, stall_warnings=False, languages=None):
         self.parameters = {}
         self.headers['Content-type'] = "application/x-www-form-urlencoded"
         if self.running:
@@ -225,6 +225,8 @@ class Stream(object):
             self.parameters['count'] = count
         if stall_warnings:
             self.parameters['stall_warnings'] = stall_warnings
+        if languages:
+            self.parameters['language'] = ','.join(map(str, languages))
         self.body = urlencode_noplus(self.parameters)
         self.parameters['delimited'] = 'length'
         self._start(async)