Skip to content

Commit ce36f96

Browse files
committed
Bump streaming to API v1.1.
1 parent acfee89 commit ce36f96

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tweepy/streaming.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from tweepy.utils import import_simplejson, urlencode_noplus
1515
json = import_simplejson()
1616

17-
STREAM_VERSION = 1
17+
STREAM_VERSION = '1.1'
1818

1919

2020
class StreamListener(object):
@@ -186,7 +186,7 @@ def firehose(self, count=None, async=False):
186186
self.parameters = {'delimited': 'length'}
187187
if self.running:
188188
raise TweepError('Stream object already connected!')
189-
self.url = '/%i/statuses/firehose.json?delimited=length' % STREAM_VERSION
189+
self.url = '/%s/statuses/firehose.json?delimited=length' % STREAM_VERSION
190190
if count:
191191
self.url += '&count=%s' % count
192192
self._start(async)
@@ -195,14 +195,14 @@ def retweet(self, async=False):
195195
self.parameters = {'delimited': 'length'}
196196
if self.running:
197197
raise TweepError('Stream object already connected!')
198-
self.url = '/%i/statuses/retweet.json?delimited=length' % STREAM_VERSION
198+
self.url = '/%s/statuses/retweet.json?delimited=length' % STREAM_VERSION
199199
self._start(async)
200200

201201
def sample(self, count=None, async=False):
202202
self.parameters = {'delimited': 'length'}
203203
if self.running:
204204
raise TweepError('Stream object already connected!')
205-
self.url = '/%i/statuses/sample.json?delimited=length' % STREAM_VERSION
205+
self.url = '/%s/statuses/sample.json?delimited=length' % STREAM_VERSION
206206
if count:
207207
self.url += '&count=%s' % count
208208
self._start(async)
@@ -213,7 +213,7 @@ def filter(self, follow=None, track=None, async=False, locations=None,
213213
self.headers['Content-type'] = "application/x-www-form-urlencoded"
214214
if self.running:
215215
raise TweepError('Stream object already connected!')
216-
self.url = '/%i/statuses/filter.json?delimited=length' % STREAM_VERSION
216+
self.url = '/%s/statuses/filter.json?delimited=length' % STREAM_VERSION
217217
if follow:
218218
self.parameters['follow'] = ','.join(map(str, follow))
219219
if track:

0 commit comments

Comments
 (0)