Shoutcast Statistics

\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(‘‘,$content);
$status = explode(‘
‘,$status[1]);
if($status[0] == 0)
{
die(‘

Our radio is currently offline!
‘);
}

$listeners = explode(‘‘,$content);
$listeners = explode(‘
‘,$listeners[1]);

$maxlisteners = explode(‘‘,$content);
$maxlisteners = explode(‘
‘,$maxlisteners[1]);

$servertitle = explode(‘‘,$content);
$servertitle = explode(‘
‘,$servertitle[1]);

$song = explode(‘‘,$content);<br /> for($i=1; $i<=10; $i++) { $song[$i] = explode('‘,$song[$i]);
$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 ‘

‘;
?>

Share

Comments

comments

')