Added rest of stream api methods. Not tested since requires agreement.
authorJosh Roesslein <jroesslein@gmail.com>
Sat, 8 Aug 2009 17:48:16 +0000 (12:48 -0500)
committerJosh Roesslein <jroesslein@gmail.com>
Sat, 8 Aug 2009 17:48:16 +0000 (12:48 -0500)
tweepy/streaming.py

index 2b9491fc0749c14b532d9ccf2946b6035035eb57..a27e1d1e167e84f721c4c181e65fd4b2c9ee1041 100644 (file)
@@ -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!')