Commit e2523089 authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Added rest of stream api methods. Not tested since requires agreement.

parent 92fd341d
......@@ -85,6 +85,40 @@ class Stream(object):
# TODO: we should probably also parse delete/track messages
# and pass to a callback
def firehose(self, count=None, ):
if self.running:
raise TweepError('Stream object already connected!')
self.url = '/firehose.json?delimited=length'
if count:
self.url += '&count=%s' % count
self.running = True
Thread(target=self._run).start()
def gardenhose(self):
if self.running:
raise TweepError('Stream object already connected!')
self.url = '/gardenhose.json?delimited=length'
self.running = True
Thread(target=self._run).start()
def birddog(self, follow, count=None):
if self.running:
raise TweepError('Stream object already connected!')
self.url = '/birddog.json?delimited=length&follow=%s' % str(follow).strip('[]').replace(' ', '')
if count:
self.url += '&count=%s' % count
self.running = True
Thread(target=self._run).start()
def shadow(self, follow, count=None):
if self.running:
raise TweepError('Stream object already connected!')
self.url = '/shadow.json?delimited=length&follow=%s' % str(follow).strip('[]').replace(' ', '')
if count:
self.url += '&count=%s' % count
self.running = True
Thread(target=self._run).start()
def spritzer(self):
if self.running:
raise TweepError('Stream object already connected!')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment