Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamband/ripple
Get a track/album information from the URL
https://github.com/jamband/ripple
bandcamp music oembed php soundcloud vimeo youtube
Last synced: 2 months ago
JSON representation
Get a track/album information from the URL
- Host: GitHub
- URL: https://github.com/jamband/ripple
- Owner: jamband
- License: mit
- Created: 2015-09-12T15:08:38.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-04-20T05:43:56.000Z (8 months ago)
- Last Synced: 2024-04-20T06:35:02.984Z (8 months ago)
- Topics: bandcamp, music, oembed, php, soundcloud, vimeo, youtube
- Language: PHP
- Homepage:
- Size: 362 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ripple
[![Build Status](https://github.com/jamband/ripple/workflows/ci/badge.svg)](https://github.com/jamband/ripple/actions?workflow=ci) [![Latest Stable Version](https://img.shields.io/packagist/v/jamband/ripple)](https://packagist.org/packages/jamband/ripple) [![Total Downloads](https://img.shields.io/packagist/dt/jamband/ripple)](https://packagist.org/packages/jamband/ripple)
Get a track/album information from the URL.
## Requirements
PHP 8.0 or later
## Installation
```
composer require jamband/ripple
```## Usage
```php
// basic
$ripple = new Jamband\Ripple\Ripple();
$ripple->request('https://example.bandcamp.com/track/title');
$ripple->provider(); // Bandcamp
$ripple->url(); // https://example.bandcamp.com/track/title
$ripple->id(); // 123
$ripple->title(); // Title, by Artist
$ripple->image(); // https://img.example.com/img/123.jpg
``````php
// embed
$ripple = new Jamband\Ripple\Ripple();
$ripple->options(['embed' => ['Bandcamp' => 'size=large/']]);
$ripple->request('https://example.bandcamp.com/track/title');
$embed = $ripple->embed(); // https://bandcamp.com/EmbeddedPlayer/track=123/size=large/
?>```
```php
// custom curl options
$ripple = new Jamband\Ripple\Ripple();
$ripple->options(['curl' => [
// CURLOPT_TIMEOUT => 8,
// CURLOPT_USERAGENT => '...',
// ...
]]);
$ripple->request('https://example.bandcamp.com/track/title');
``````php
// mock response
$ripple = new Jamband\Ripple\Ripple();
$ripple->options(['response' => '...']);
$ripple->request('https://example.bandcamp.com/track/title');
```## Valid URLs
```
Bandcamp:
https://{subdomain}.bandcamp.com/track/{title}
https://{subdomain}.bandcamp.com/album/{title}
https://{subdomain}.bandcamp.com/releases
https?://{domain}/track/{title}
https?://{domain}/album/{title}
https?://{domain}/releasesSoundCloud:
https://soundcloud.com/{account}/{title}
https://soundcloud.com/{account}/sets/{title}Vimeo:
https://vimeo.com/{id}YouTube:
https://www.youtube.com/watch?v={id}
https://www.youtube.com/playlist?list={id}
https://youtu.be/{id}
```## Supported Providers
- Bandcamp
- SoundCloud
- Vimeo
- YouTube## License
Ripple is licensed under the MIT license.