{"id":18985052,"url":"https://github.com/azuracast/nowplaying","last_synced_at":"2025-04-15T11:04:08.148Z","repository":{"id":45591614,"uuid":"148442867","full_name":"AzuraCast/nowplaying","owner":"AzuraCast","description":"A lightweight PHP adapter for viewing the current now playing data in Icecast and SHOUTcast 1/2. A part of the AzuraCast software suite.","archived":false,"fork":false,"pushed_at":"2024-07-01T01:39:55.000Z","size":178,"stargazers_count":29,"open_issues_count":0,"forks_count":9,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-15T11:04:05.344Z","etag":null,"topics":["azuracast","icecast","library","php","shoutcast","web-radio","webcasting"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AzuraCast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"AzuraCast","open_collective":"azuracast","patreon":"AzuraCast"}},"created_at":"2018-09-12T07:52:59.000Z","updated_at":"2024-12-14T01:18:09.000Z","dependencies_parsed_at":"2023-01-23T10:30:31.282Z","dependency_job_id":"edeee01c-b856-4ff6-be21-e379a77c6500","html_url":"https://github.com/AzuraCast/nowplaying","commit_stats":{"total_commits":86,"total_committers":4,"mean_commits":21.5,"dds":0.2906976744186046,"last_synced_commit":"20d44ab956fc2b85583f0bfe49cb66f800342a0f"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzuraCast%2Fnowplaying","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzuraCast%2Fnowplaying/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzuraCast%2Fnowplaying/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzuraCast%2Fnowplaying/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AzuraCast","download_url":"https://codeload.github.com/AzuraCast/nowplaying/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249058372,"owners_count":21205910,"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":["azuracast","icecast","library","php","shoutcast","web-radio","webcasting"],"created_at":"2024-11-08T16:24:30.189Z","updated_at":"2025-04-15T11:04:08.121Z","avatar_url":"https://github.com/AzuraCast.png","language":"PHP","funding_links":["https://github.com/sponsors/AzuraCast","https://opencollective.com/azuracast","https://patreon.com/AzuraCast"],"categories":[],"sub_categories":[],"readme":"# NowPlaying\r\n\r\nNowPlaying is a lightweight, modern, object-oriented PHP library that abstracts out the currently playing metadata from\r\npopular radio broadcast software into a single common return format.\r\n\r\n### Installing\r\n\r\nNowPlaying is a Composer package that you can include in your project by running:\r\n\r\n```bash\r\ncomposer require azuracast/nowplaying\r\n```\r\n\r\n### Compatibility\r\n\r\n|                | Now Playing data | Detailed client information |\r\n|----------------|------------------|-----------------------------|\r\n| Icecast (2.4+) | ✅                | ✅                           |\r\n| SHOUTcast 2    | ✅                | ✅                           |\r\n| SHOUTcast 1    | ✅                | ❌                           |\r\n\r\n### Usage Example\r\n\r\n```php\r\n\u003c?php\r\n// Example PSR-17 and PSR-18 implementation from Guzzle 7\r\n// Install those with:\r\n//   composer require guzzlehttp/guzzle\r\n\r\n$httpFactory = new GuzzleHttp\\Psr7\\HttpFactory();\r\n$adapterFactory = new NowPlaying\\AdapterFactory(\r\n    $httpFactory,\r\n    $httpFactory,\r\n    new GuzzleHttp\\Client\r\n);\r\n\r\n$adapter = $adapterFactory-\u003egetAdapter(\r\n    NowPlaying\\Enums\\AdapterType::Shoutcast2,\r\n    'http://my-station-url.example.com:8000'\r\n);\r\n\r\n// You can also call:\r\n// $adapterFactory-\u003egetShoutcast2Adapter('http://url');\r\n\r\n// Optionally set administrator password\r\n$adapter-\u003esetAdminUsername('admin'); // \"admin\" is the default\r\n$adapter-\u003esetAdminPassword('AdminPassword!');\r\n\r\n// The first argument to the functions is the mount point or\r\n// stream ID (SID), to pull one specific stream's information.\r\n$now_playing = $adapter-\u003egetNowPlaying('1');\r\n\r\n$clients = $adapter-\u003egetClients('1');\r\n```\r\n\r\nExample \"now playing\" response (PHP objects represented in JSON):\r\n\r\n```json\r\n{\r\n  \"currentSong\": {\r\n    \"text\": \"Joe Bagale - Until We Meet Again\",\r\n    \"title\": \"Until We Meet Again\",\r\n    \"artist\": \"Joe Bagale\"\r\n  },\r\n  \"listeners\": {\r\n    \"total\": 0,\r\n    \"unique\": 0\r\n  },\r\n  \"meta\": {\r\n    \"online\": true,\r\n    \"bitrate\": 128,\r\n    \"format\": \"audio/mpeg\"\r\n  },\r\n  \"clients\": []\r\n}\r\n```\r\n\r\nExample \"clients\" response:\r\n\r\n```json\r\n[\r\n  {\r\n    \"uid\": 1,\r\n    \"ip\": \"127.0.0.1\",\r\n    \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36\",\r\n    \"connectedSeconds\": 123\r\n  }\r\n]\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazuracast%2Fnowplaying","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazuracast%2Fnowplaying","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazuracast%2Fnowplaying/lists"}