PHP code example of jamband / ripple

1. Go to this page and download the library: Download jamband/ripple library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jamband / ripple example snippets


// 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

// 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/

// custom curl options
$ripple = new Jamband\Ripple\Ripple();
$ripple->options(['curl' => [
    // CURLOPT_TIMEOUT => 8,
    // CURLOPT_USERAGENT => '...',
    // ...
]]);
$ripple->request('https://example.bandcamp.com/track/title');

// mock response
$ripple = new Jamband\Ripple\Ripple();
$ripple->options(['response' => '...']);
$ripple->request('https://example.bandcamp.com/track/title');