From: Josh Roesslein Date: Sat, 8 Aug 2009 17:48:16 +0000 (-0500) Subject: Added rest of stream api methods. Not tested since requires agreement. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e2523089f2b65c2b1fcaecb0c81fe23eaf2f2757;p=tweepy.git Added rest of stream api methods. Not tested since requires agreement. --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 2b9491f..a27e1d1 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -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!')