Added language option at sample streaming endpoint
authorkureta <skureta@gmail.com>
Tue, 19 Aug 2014 20:45:26 +0000 (23:45 +0300)
committerkureta <skureta@gmail.com>
Tue, 19 Aug 2014 20:45:26 +0000 (23:45 +0300)
tweepy/streaming.py

index a444e278d244b4e2c7c2961525cd887fcdb1ae64..07fb5beac4327a110c8573e2c408da823d2a1d7b 100644 (file)
@@ -290,10 +290,13 @@ class Stream(object):
         self.url = '/%s/statuses/retweet.json' % STREAM_VERSION
         self._start(async)
 
-    def sample(self, async=False):
+    def sample(self, async=False, language=None):
         if self.running:
             raise TweepError('Stream object already connected!')
         self.url = '/%s/statuses/sample.json?delimited=length' % STREAM_VERSION
+        if language:
+            self.url += '&language=%s' % language
+            self.parameters['language'] = language
         self._start(async)
 
     def filter(self, follow=None, track=None, async=False, locations=None,