<?php
## Streamanzeiger PHP Seite ##
$server = "relay.181.fm";
$port = 8004;
$fp = @fsockopen($server, $port, $errno, $errstr, 30);
if ($fp) {
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp))
$page .= fgets($fp, 1000);
fclose($fp);
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);
$numbers = explode(",", $page);
$shoutcast_currentlisteners = $numbers[0];
$connected = $numbers[1];
if($connected == 1) {
$radio_status = 1;
$wordconnected = "yes";
}
else
$wordconnected = "no";
$shoutcast_peaklisteners = $numbers[2];
$shoutcast_maxlisteners = $numbers[3];
$shoutcast_reportedlisteners = $numbers[4];
$shoutcast_bitrate = $numbers[5];
$shoutcast_cursong = $numbers[6];
$shoutcast_curbwidth = $shoutcast_bitrate * $shoutcast_currentlisteners;
$shoutcast_peakbwidth = $shoutcast_bitrate * $shoutcast_peaklisteners;
}
## output on ##
echo '<meta http-equiv="refresh" content=5;><html><head><title>Streamanzeiger</title></head><body>';
echo 'Anzahl der hoerer: ' . $shoutcast_currentlisteners . '<br />';
echo 'Bitrate: ' . $shoutcast_bitrate .'kb/s <br />';
echo 'Zuhoerer Peak: ' . $shoutcast_peaklisteners . '<br />';
echo 'Maximale Zuhoerer: ' . $shoutcast_maxlisteners . '<br />';
echo 'Aktueller Song: >>' . $shoutcast_cursong . '<< <br />';
echo '</body></html>';
## output off ##