Find spotify information
Posted: Mon Nov 02, 2009 4:11 am
I want to find spotify information from a Spotify link, and I found a site where I can find it.
Code: Select all
<?php
if(strlen($_GET['uri']) == 22) {
$url = file_get_contents("http://spotify.url.fi/track/".$_GET['uri']);
preg_match('/<title>(.*)<\/title>/i',$url,$output);
$explode = explode("—", $output[1]);
print_r($explode);
?>
[Spotify Info:] <?php echo $artist; ?> - <?php echo $song; ?> [<?php echo $album; ?>]
<?
} else {
echo 'Error - wrong link format.';
}
?>How do I solve this, and if it's not possible, does anyone know a way to find spotify information?Warning: file_get_contents(http://spotify.url.fi/track/4OSRg1faLprPCt86C80zWt) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /public_html/spotInfo.php on line 3