Skip to content

Instantly share code, notes, and snippets.

@aurels
Created June 27, 2012 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurels/3003972 to your computer and use it in GitHub Desktop.
Save aurels/3003972 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<?php
$url = "https://rendez-vous-digital.pro/api/public/albums.json?api_key=MY_API_KEY_HERE&artists_scope=all&page=1&artists=281";
$raw_data = file_get_contents($url);
$data = json_decode($raw_data);
?>
<?php foreach($data->albums as $album){ ?>
<h2><?php print $album->name ?> / UPC <?php print $album->upc_code ?></h2>
<img src="<?php print $album->cover->normal ?>" />
<h3>Artistes</h3>
<?php print $album->artist_names ?>
<h3>Liens</h3>
<ul>
<?php foreach ($album->links as $link) { ?>
<li>
<a href="<?php print $link->url ?>">
<?php print $link->platform ?>
</a>
</li>
<?php } ?>
</ul>
<h3>Morceaux</h3>
<ul>
<?php foreach ($album->tracks as $track) { ?>
<li>
<?php print $track->position ?> -
<?php print $track->length ?> -
<?php print $track->isrc_code ?> -
<a href="<?php print $track->preview_url ?>">
<?php print $track->name ?>
</a>
(<?php print $track->artist_names ?>)
</li>
<?php } ?>
</ul>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment