I’m trying to install a script to show the last few songs I’ve listened to. I haven’t been able to use it sucessfully on my DH account because it uses file_get_contents and well I don’t know how to use curl instead of that.
The original code is:
$xml = @file_get_contents(DEBUG===true ? ‘aliguana.xml’
I tried replacing that bit with the curl stuff but it just isn’t working.
Here’s what I have:
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, ‘http://ws.audioscrobbler.com/1.0/user/’.$user.’/recenttracks.xml’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$xml = curl_exec($ch);
// display file
Any help would be vastly appreciated. The original script and instructions can be found at http://www.audioscrobbler.net/wiki/RecentlyPlayedImageV2 and it’s the RPI.php file I’m trying to change.