{"id":15059013,"url":"https://github.com/keinos/mastodon_streamingapi_listener","last_synced_at":"2026-01-02T13:13:41.397Z","repository":{"id":57005346,"uuid":"282361699","full_name":"KEINOS/Mastodon_StreamingAPI_Listener","owner":"KEINOS","description":"✅  PHP7 class that listens to the Mastodon Streaming API's server-sent messages.","archived":false,"fork":false,"pushed_at":"2021-02-23T05:41:00.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-13T21:03:39.977Z","etag":null,"topics":["mastodon","mastodon-api","php7","php8","streaming-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KEINOS.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":"2020-07-25T03:20:33.000Z","updated_at":"2021-02-23T05:41:03.000Z","dependencies_parsed_at":"2022-08-21T14:30:23.215Z","dependency_job_id":null,"html_url":"https://github.com/KEINOS/Mastodon_StreamingAPI_Listener","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KEINOS%2FMastodon_StreamingAPI_Listener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KEINOS%2FMastodon_StreamingAPI_Listener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KEINOS%2FMastodon_StreamingAPI_Listener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KEINOS%2FMastodon_StreamingAPI_Listener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KEINOS","download_url":"https://codeload.github.com/KEINOS/Mastodon_StreamingAPI_Listener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243558477,"owners_count":20310574,"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":["mastodon","mastodon-api","php7","php8","streaming-api"],"created_at":"2024-09-24T22:35:23.408Z","updated_at":"2026-01-02T13:13:41.355Z","avatar_url":"https://github.com/KEINOS.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://travis-ci.com/KEINOS/Mastodon_StreamingAPI_Listener.svg?branch=master)](https://travis-ci.com/github/KEINOS/Mastodon_StreamingAPI_Listener \"View Build Status on Travis\")\n[![](https://img.shields.io/coveralls/github/KEINOS/Mastodon_StreamingAPI_Listener)](https://coveralls.io/github/KEINOS/Mastodon_StreamingAPI_Listener?branch=master \"Code Coverage on COVERALLS\")\n[![](https://img.shields.io/scrutinizer/quality/g/KEINOS/Mastodon_StreamingAPI_Listener/master)](https://scrutinizer-ci.com/g/KEINOS/Mastodon_StreamingAPI_Listener/?branch=master \"Code quality in Scrutinizer\")\n[![](https://img.shields.io/packagist/php-v/keinos/mastodon-streaming-api-parser)](https://github.com/KEINOS/Mastodon_StreamingAPI_Listener/blob/master/.travis.yml \"Version Support\")\n\n# Simple Mastodon Streaming API Listener\n\nThis is a PHP class that listens to the Mastodon Streaming API's server-sent messages.\n\n## Install\n\n```bash\ncomposer require keinos/mastodon-streaming-api-listener\n```\n\n## Usage\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\n$conf = [\n    // Your Mastodon server URL\n    'url_host' =\u003e 'https://qiitadon.com/',\n];\n\n$listener = new \\KEINOS\\MSTDN_TOOLS\\Listener\\Listener($conf);\n\n/**\n * $listener ............ The iterator.\n *   $event_name ........ Event name. (\"update\" or \"delete\")\n *   $data_payload ...... Data of the event in JSON string.\n */\nforeach($listener as $event_name =\u003e $data_payload) {\n    echo 'Event name: ' . $event_name . PHP_EOL;\n    echo 'Data: '. PHP_EOL;\n    print_r(json_decode($data_payload));\n}\n\n```\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\n// Alias \\KEINOS\\MSTDN_TOOLS\\Listener\\Listener as Listener\nuse KEINOS\\MSTDN_TOOLS\\Listener\\Listener;\n\n$conf = [\n    'url_host' =\u003e 'https://qiitadon.com/',\n    // If the server is in \"whitelist-mode\" then you'll need an access token.\n    'access_token' =\u003e 'YOUR_ACCESS_TOKEN',\n];\n\n$listener = new Listener($conf);\n\nforeach($listener as $event_name =\u003e $data_payload) {\n    echo 'Event name: ' . $event_name . PHP_EOL;\n    echo 'Data: '. PHP_EOL;\n    print_r(json_decode($data_payload));\n}\n\n```\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\nuse KEINOS\\MSTDN_TOOLS\\Listener\\Listener;\n\n$conf = [\n    'url_host' =\u003e 'https://qiitadon.com/',\n    // To listen the local time line stream set 'local'. 'public' is the default.\n    'type_stream' =\u003e 'local',\n];\n\n$listener = new Listener($conf);\n\nforeach($listener as $event_name =\u003e $data_payload) {\n    echo 'Event name: ' . $event_name . PHP_EOL;\n    echo 'Data: '. PHP_EOL;\n    print_r(json_decode($data_payload));\n}\n\n```\n\n## Package Information\n\n- Packagist: https://packagist.org/packages/keinos/mastodon-streaming-api-listener\n- Source: https://github.com/KEINOS/Mastodon_StreamingAPI_Listener\n- Issues: https://github.com/KEINOS/Mastodon_StreamingAPI_Listener/issues\n- License: [MIT](https://github.com/KEINOS/Mastodon_StreamingAPI_Listener/blob/master/LICENSE)\n- Authors: [KEINOS and the contributors](https://github.com/KEINOS/Mastodon_StreamingAPI_Listener/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeinos%2Fmastodon_streamingapi_listener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeinos%2Fmastodon_streamingapi_listener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeinos%2Fmastodon_streamingapi_listener/lists"}