From e2523089f2b65c2b1fcaecb0c81fe23eaf2f2757 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Sat, 8 Aug 2009 12:48:16 -0500 Subject: [PATCH] Added rest of stream api methods. Not tested since requires agreement. --- tweepy/streaming.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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!') -- 2.25.1