<?php 
// Error reporting on.
error_reporting(-1);

// AUS DER API
$data = file_get_contents("http://94.130.113.53/api/nowplaying");
$decoded = json_decode($data, true);

$live = $decoded[0]['live']['is_live'];
$streamer = $decoded[0]['live']['streamer_name'];
$bitr = $decoded[0]['listeners']['current'];


// CONFIGURATION 
$ip = '94.130.113.53'; // IP 
$port = '8000'; // Port 
$sid = '1'; // StreamID 

// PHP, DONT TOUCH WHEN YOU DONT KNOW WHAT YOURE DOING. 
$shoutcast = simplexml_load_file("http://".$ip.":".$port."/stats?sid=".$sid); 
$listeners = $shoutcast->CURRENTLISTENERS; 
$song = $shoutcast->SONGTITLE; 
$dj = $shoutcast->SERVERTITLE;
$bitrate = $shoutcast->BITRATE;
$maxlistener = $shoutcast->MAXLISTENERS;

// EXAMPLES 
echo "Listener: ";
echo $listeners;echo" / ";echo $maxlistener; // Listeners 
echo "<br />";
echo "Song: ";
echo $song; // Song 
echo "<br />";
echo "Moderator: ";
echo $dj; // DJ 
echo "<br />";
echo "Bitrate: ";
echo $bitrate;
echo $bitr; // Bitrate 
echo "<br />";
echo "Aktuell Live: ";
if(!$live){
echo "Playlist";   
}else{
    echo $streamer;
}


// MADE BY PEPIJN :) 
?>