Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // http://api.radionomy.com/currentsong.cfm?radiouid=xxx&apikey=xxx&callmeback=yes&type=xml&cover=yes&previous=yes
- $uuid = "xxx";
- $apikey = "xxx";
- $url = "http://api.radionomy.com/currentsong.cfm?radiouid=".$uuid."&apikey=".$apikey."&callmeback=yes&type=xml&cover=yes&previous=yes";
- // print($url);
- // create curl resource
- $ch = curl_init();
- // set url
- curl_setopt($ch, CURLOPT_URL, $url);
- //return the transfer as a string
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- // $output contains the output string
- $output = curl_exec($ch);
- // close curl resource to free up system resources
- curl_close($ch);
- $xml = simplexml_load_string($output);
- $json = json_encode($xml);
- $array = json_decode($json,TRUE);
- print('titel: '. $array['track']['title']);
- print("<br>");
- print('artiest: ' . $array['track']['artists']);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement