2017 © Pedro Peláez
 

library streaming-bird

A PHP client for the Twitter Streaming APIs inspired from Phirehose.

image

owlycode/streaming-bird

A PHP client for the Twitter Streaming APIs inspired from Phirehose.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

StreamingBird is an automatically tested, PSR-4 compliant client for Twitter's streaming API., (*1)

Build Status, (*2)

How to install

With composer : composer require owlycode/streaming-bird., (*3)

Example usage

use OwlyCode\StreamingBird\StreamReader;
use OwlyCode\StreamingBird\StreamingBird;

 // Change these with yours.
$oauthToken = 'my token';
$oauthSecret = 'secret';
$consumerKey = 'my key';
$consumerSecret = 'secret';

$bird = new StreamingBird($consumerKey, $consumerSecret, $oauthToken, $oauthSecret);

$bird
    ->createStreamReader(StreamReader::METHOD_FILTER)
    ->setTrack(['hello', 'hola', 'bonjour']) // Fetch every tweet containing one of the following words
    ->consume(function ($tweet) { // Now we provide a callback to execute on every received tweet.
        echo '------------------------' . "\n";
        echo $tweet['text'] . "\n";
    })
;

Monitoring

StreamingBird comes with some statistics about the stream that you can access. At the moment it is an early approach with few informations but it is meant to grow in the future., (*4)

$reader->consume(function ($tweet, $monitor) use ($output) {
    echo '------------------------' . "\n";
    echo $monitor->get('tweets') . "\n"; // The total number of received tweets
    echo $monitor->get('idle_time') . "\n"; // Elapsed seconds between the last two tweets.
    echo $monitor->get('max_idle_time') . "\n"; // The maximum idle time since the beginning.
    echo $tweet['text'] . "\n";
});

Running the tests

Simply run :, (*5)

composer install
./bin/vendor/phpunit

The Versions

12/02 2018

dev-master

9999999-dev https://github.com/OwlyCode/StreamingBird

A PHP client for the Twitter Streaming APIs inspired from Phirehose.

  Sources   Download

GPL LGPL-2.0-only

The Requires

  • php ~5.6|~7.0

 

The Development Requires

api php twitter streaming

12/02 2018

v0.1.1

0.1.1.0 https://github.com/OwlyCode/StreamingBird

A PHP client for the Twitter Streaming APIs inspired from Phirehose.

  Sources   Download

LGPL-2.0-only

The Requires

  • php ~5.6|~7.0

 

The Development Requires

api php twitter streaming

18/03 2016

v0.1.0

0.1.0.0 https://github.com/OwlyCode/StreamingBird

A PHP client for the Twitter Streaming APIs inspired from Phirehose.

  Sources   Download

GPL

The Requires

  • php ~5.6|~7.0

 

The Development Requires

api php twitter streaming