{"id":23182022,"url":"https://github.com/owlycode/streamingbird","last_synced_at":"2025-08-18T13:34:11.568Z","repository":{"id":57034438,"uuid":"54137013","full_name":"OwlyCode/StreamingBird","owner":"OwlyCode","description":"A PHP client for the Twitter Streaming APIs inspired from Phirehose","archived":false,"fork":false,"pushed_at":"2018-02-12T08:43:44.000Z","size":28,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-18T09:53:12.262Z","etag":null,"topics":["twitter","twitter-streaming-api"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OwlyCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-17T17:15:33.000Z","updated_at":"2021-05-01T08:17:36.000Z","dependencies_parsed_at":"2022-08-24T00:31:17.549Z","dependency_job_id":null,"html_url":"https://github.com/OwlyCode/StreamingBird","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OwlyCode%2FStreamingBird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OwlyCode%2FStreamingBird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OwlyCode%2FStreamingBird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OwlyCode%2FStreamingBird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OwlyCode","download_url":"https://codeload.github.com/OwlyCode/StreamingBird/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230238642,"owners_count":18195059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["twitter","twitter-streaming-api"],"created_at":"2024-12-18T08:19:10.246Z","updated_at":"2024-12-18T08:19:10.847Z","avatar_url":"https://github.com/OwlyCode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"StreamingBird is an automatically tested, PSR-4 compliant client for Twitter's streaming API.\n\n[![Build Status](https://travis-ci.org/OwlyCode/StreamingBird.svg?branch=master)](https://travis-ci.org/OwlyCode/StreamingBird)\n\nHow to install\n--------------\n\nWith composer : `composer require owlycode/streaming-bird`.\n\nExample usage\n-------------\n\n```php\nuse OwlyCode\\StreamingBird\\StreamReader;\nuse OwlyCode\\StreamingBird\\StreamingBird;\n\n // Change these with yours.\n$oauthToken = 'my token';\n$oauthSecret = 'secret';\n$consumerKey = 'my key';\n$consumerSecret = 'secret';\n\n$bird = new StreamingBird($consumerKey, $consumerSecret, $oauthToken, $oauthSecret);\n\n$bird\n    -\u003ecreateStreamReader(StreamReader::METHOD_FILTER)\n    -\u003esetTrack(['hello', 'hola', 'bonjour']) // Fetch every tweet containing one of the following words\n    -\u003econsume(function ($tweet) { // Now we provide a callback to execute on every received tweet.\n        echo '------------------------' . \"\\n\";\n        echo $tweet['text'] . \"\\n\";\n    })\n;\n\n```\n\nMonitoring\n----------\n\nStreamingBird comes with some statistics about the stream that you can access. At the moment\nit is an early approach with few informations but it is meant to grow in the future.\n\n```php\n$reader-\u003econsume(function ($tweet, $monitor) use ($output) {\n    echo '------------------------' . \"\\n\";\n    echo $monitor-\u003eget('tweets') . \"\\n\"; // The total number of received tweets\n    echo $monitor-\u003eget('idle_time') . \"\\n\"; // Elapsed seconds between the last two tweets.\n    echo $monitor-\u003eget('max_idle_time') . \"\\n\"; // The maximum idle time since the beginning.\n    echo $tweet['text'] . \"\\n\";\n});\n```\n\nRunning the tests\n-----------------\n\nSimply run :\n\n```bash\ncomposer install\n./bin/vendor/phpunit\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowlycode%2Fstreamingbird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowlycode%2Fstreamingbird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowlycode%2Fstreamingbird/lists"}