Permalink
Browse files

1272230428

  • Loading branch information...
1 parent d1bf6e6 commit abe4c07cc172ebcfbda75bfc933572ab561b8491 @amanelis committed Apr 25, 2010
Showing with 32 additions and 0 deletions.
  1. +16 −0 phirehose/consume.php
  2. +16 −0 phirehose/sample.php
View
@@ -0,0 +1,16 @@
+<?PHP
+
+require_once('hose/lib/Phirehose.php');
+class MyStream extends Phirehose
+{
+ public function enqueueStatus($status)
+ {
+ print $status;
+ }
+}
+
+$stream = new MyStream('zandermane', 'alex18257');
+$stream->consume();
+
+
+?>
View
@@ -0,0 +1,16 @@
+<?PHP
+require_once("hose/lib/Phirehose.php");
+
+class SampleConsumer extends Phirehose {
+
+ public function enqueueStatus($status) {
+ $data = json_decode($status, true);
+ if(is_array($data) && isset($data['user']['screen_name'])) {
+ print $data['user']['screen_name'].': '.urldecode($data['text'])."<br />";
+ }
+ }
+
+}
+
+$sc = new SampleConsumer('zandermane', 'alex18257', Phirehose::METHOD_SAMPLE);
+$sc->consume();

0 comments on commit abe4c07

Please sign in to comment.