Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aportela/musicbrainz-wrapper
Custom php musicbrainz api wrapper
https://github.com/aportela/musicbrainz-wrapper
composer-package musicbrainz musicbrainz-api php php8
Last synced: about 5 hours ago
JSON representation
Custom php musicbrainz api wrapper
- Host: GitHub
- URL: https://github.com/aportela/musicbrainz-wrapper
- Owner: aportela
- License: agpl-3.0
- Created: 2022-04-18T21:15:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T08:32:09.000Z (almost 1 year ago)
- Last Synced: 2024-12-09T03:51:22.260Z (25 days ago)
- Topics: composer-package, musicbrainz, musicbrainz-api, php, php8
- Language: PHP
- Homepage:
- Size: 66.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# musicbrainz-wrapper
Custom musicbrainz api wrapper
## Requirements
- mininum php version 8.x
- curl extension must be enabled (aportela/httprequest-wrapper)## Install (composer) dependencies:
```
composer require aportela/musicbrainz-wrapper
```## Code example:
```
get("ca891d65-d9b0-4258-89f7-e6ba29d83767");
// parse raw json string (use this if you have an stored pre-cached json music brainz artist api response) into artist object
$mbArtist->parse($mbArtist->raw);
// get youtube url artist relationships
$urls = $mbArtist->getURLRelationshipValues(\aportela\MusicBrainzWrapper\ArtistURLRelationshipType::SOCIAL_YOUTUBE);// XML format
$mbArtist = new \aportela\MusicBrainzWrapper\Artist($logger, \aportela\MusicBrainzWrapper\APIFormat::XML);
// get artist object from MusicBrainz API
$mbArtist->get("ca891d65-d9b0-4258-89f7-e6ba29d83767");
// parse raw xml string (use this if you have an stored pre-cached xml music brainz artist api response) into artist object
$mbArtist->parse($mbArtist->raw);
// get youtube url artist relationships
$urls = $mbArtist->getURLRelationshipValues(\aportela\MusicBrainzWrapper\ArtistURLRelationshipType::SOCIAL_YOUTUBE);// JSON format
$mbRelease = new \aportela\MusicBrainzWrapper\Release($logger, \aportela\MusicBrainzWrapper\APIFormat::JSON);
// get release object from MusicBrainz API
$mbRelease->get("723df70e-f79e-4602-8d1f-13cad619a6e8");
// parse raw json string (use this if you have an stored pre-cached json music brainz release api response) into release object
$mbRelease->parse($mbRelease->raw);// XML format
$mbRelease = new \aportela\MusicBrainzWrapper\Release($logger, \aportela\MusicBrainzWrapper\APIFormat::XML);
// get release object from MusicBrainz API
$mbRelease->get("723df70e-f79e-4602-8d1f-13cad619a6e8");
// parse raw xml string (use this if you have an stored pre-cached xml music brainz release api response) into release object
$mbRelease->parse($mbRelease->raw);// JSON format
$mbRecording = new \aportela\MusicBrainzWrapper\Recording($logger, \aportela\MusicBrainzWrapper\APIFormat::JSON);
// get recording object from MusicBrainz API
$mbRecording->get("4fba6ee9-b49d-4503-ba34-7337ed2e972f");
// parse raw json string (use this if you have an stored pre-cached json music brainz recording api response) into recording object
$mbRecording->parse($mbRecording->raw);// XML format
$mbRecording = new \aportela\MusicBrainzWrapper\Recording($logger, \aportela\MusicBrainzWrapper\APIFormat::XML);
// get recording object from MusicBrainz API
$mbRecording->get("4fba6ee9-b49d-4503-ba34-7337ed2e972f");
// parse raw xml string (use this if you have an stored pre-cached json music brainz recording api response) into recording object
$mbRecording->parse($mbRecording->raw);
```![PHP Composer](https://github.com/aportela/musicbrainz-wrapper/actions/workflows/php.yml/badge.svg)