\n”;
} else {
fputs ($fp, “GET /admin.cgi?pass={$adminpass}&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n”);
while (!feof($fp)) {
$content .= fgets ($fp,128);
}
fclose ($fp);
}
$status = explode(‘
$status = explode(‘
if($status[0] == 0)
{
die(‘
}
$listeners = explode(‘
$listeners = explode(‘
$maxlisteners = explode(‘
$maxlisteners = explode(‘
$servertitle = explode(‘
$servertitle = explode(‘
$song = explode(‘
for($i=1; $i<=10; $i++) { $song[$i] = explode('
$song[$i] = $song[$i][0];
}
echo ‘
echo “Listeners: {$listeners[0]} / {$maxlisteners[0]}
“;
echo “Current DJ: {$servertitle[0]}
“;
echo “Current Song: {$song[1]}
“;
echo “Recent Songs:
“;
foreach($song as $id => $value)
{
if($id != 0 && $id != 1)
{
$display = $id – 1;
echo “{$display}. {$value}
“;
}
}
echo ‘
?>