Bump streaming to API v1.1.
authorJoshua Roesslein <jroesslein@gmail.com>
Sun, 10 Feb 2013 21:09:33 +0000 (13:09 -0800)
committerJoshua Roesslein <jroesslein@gmail.com>
Sun, 10 Feb 2013 21:09:33 +0000 (13:09 -0800)
tweepy/streaming.py

index 044bd3231060018cfddfb6942e8ca7381613f5c8..ab97fbdec961ba853c75b7069f55e22ebe8a5b20 100644 (file)
@@ -14,7 +14,7 @@ from tweepy.error import TweepError
 from tweepy.utils import import_simplejson, urlencode_noplus
 json = import_simplejson()
 
-STREAM_VERSION = 1
+STREAM_VERSION = '1.1'
 
 
 class StreamListener(object):
@@ -186,7 +186,7 @@ class Stream(object):
         self.parameters = {'delimited': 'length'}
         if self.running:
             raise TweepError('Stream object already connected!')
-        self.url = '/%i/statuses/firehose.json?delimited=length' % STREAM_VERSION
+        self.url = '/%s/statuses/firehose.json?delimited=length' % STREAM_VERSION
         if count:
             self.url += '&count=%s' % count
         self._start(async)
@@ -195,14 +195,14 @@ class Stream(object):
         self.parameters = {'delimited': 'length'}
         if self.running:
             raise TweepError('Stream object already connected!')
-        self.url = '/%i/statuses/retweet.json?delimited=length' % STREAM_VERSION
+        self.url = '/%s/statuses/retweet.json?delimited=length' % STREAM_VERSION
         self._start(async)
 
     def sample(self, count=None, async=False):
         self.parameters = {'delimited': 'length'}
         if self.running:
             raise TweepError('Stream object already connected!')
-        self.url = '/%i/statuses/sample.json?delimited=length' % STREAM_VERSION
+        self.url = '/%s/statuses/sample.json?delimited=length' % STREAM_VERSION
         if count:
             self.url += '&count=%s' % count
         self._start(async)
@@ -213,7 +213,7 @@ class Stream(object):
         self.headers['Content-type'] = "application/x-www-form-urlencoded"
         if self.running:
             raise TweepError('Stream object already connected!')
-        self.url = '/%i/statuses/filter.json?delimited=length' % STREAM_VERSION
+        self.url = '/%s/statuses/filter.json?delimited=length' % STREAM_VERSION
         if follow:
             self.parameters['follow'] = ','.join(map(str, follow))
         if track: