<?php
$fp
= @
fsockopen
(
$file
,
$port
, &
$errno
, &
$errstr
, 5);
if
(!
$fp
) {
echo
"<b>{$file}:{$port}</b> nicht errechbar -({$errno}) - {$errstr}\n"
;
}
else
{
fputs
(
$fp
,
"GET /7 HTTP/1.1\r\nUser-Agent:Mozilla\r\n\r\n"
);
while
(!
feof
(
$fp
)) {
$stream
=
fgets
(
$fp
,1024);
}
list(,
$stream
) =
explode
(
"<body>"
,
$stream
);
list(
$stream
) =
explode
(
"</body>"
,
$stream
);
list(
$user
,
$status
,
$user_peak
,
$user_max
, ,
$bitrate
,
$song
) =
explode
(
","
,
$stream
);
if
(
$status
==
"0"
) {
echo
"<b>{$file}:{$port}</b> ist offline!"
;
}
else
{
echo
"<b>{
$file
}:{
$port
} on Air!</b><br><br>
<b>Zuhoerer:</b> {
$user
} von {
$user_max
}<br>
<b>Hoerer - Peak:</b> {
$user_peak
}<br>
<b>Bitrate:</b> {
$bitrate
} kbits/s<br>
<b>aktueller Song:</b> {
$song
}<br>";
}
fclose(
$fp
); } ?>