Page 1 of 1
cd audio cover
Posted: Thu Feb 22, 2007 3:15 pm
by mauriello72
Hallo everybody.
I would like to know if there is a PHP script able to download an audio cd cover and info from the web. cddb.org give only name album,artist,etc, not the cover image.
Thanks
Posted: Thu Feb 22, 2007 5:19 pm
by pickle
Amazon has web services you can query.
Posted: Fri Feb 23, 2007 4:58 am
by WaldoMonster
I use
http://www.slothradio.com/covers/ to download covers.
This website is online for a long time and searches Amazon for images.
Posted: Fri Feb 23, 2007 9:44 am
by WaldoMonster
Here is a striped down version what I use in my project.
Code: Select all
<?php
$artist = 'moby';
$album = 'go';
$genre = 'p'; // p = Popular; k = Clasical
$locale = 'us'; // us, uk, de
$matches = '';
$content = file_get_contents('http://www.slothradio.com/covers/?adv=1&artist=' . rawurlencode($artist) . '&album=' . rawurlencode($album) . '&genre=' . $genre . '&imgsize=x&locale=' . $locale);
preg_match_all('/<!-- RESULT ITEM START -->.*?<img src="(http:\/\/(?:images|images-eu)\.amazon\.com.*?)"/s', $content, $matches);
foreach($matches[1] as $image)
echo $image . "<br>";
?>