Old 15th July 2003, 19:27   #1
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
PHP Code:
<?php
  
///////////////////////////////////////////
 // Author: Radu Bighiu - [email]radu@webcast.ro[/email] //
///////////////////////////////////////////

//edit below
$host "webcast.ro";
$port "8000";
//stop editing from here

$fp=fsockopen($host,$port,&$errno,&$errstr,10);
 if (!
$fp) {
echo 
"Can't connect";
}
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Mozilla - [url]www.webcast.ro\n\n[/url]");
for(
$i=0$i<30$i++) {
if(
feof($fp)) break;
$fp_data=fread($fp,31337);
usleep(500000);
 }
$fp_data=ereg_replace("^.*<body>","",$fp_data);
$fp_data=ereg_replace("</body>.*","",$fp_data);
list(
$current,$status,$peak,$max,$unique,$bitrate,$song) = explode(","$fp_data);
if (
$status == "0") {
echo 
"<center>Off Air</center>";
} else {
echo 
"<TABLE>";

//edit below - comment with "//" unnecessary lines
echo "<TR><TD>Current Listeners: </TD><TD>".$current."</TD></TR>";
//echo "<TR><TD>Server Status: </TD><TD>".$status."</TD></TR>";
echo "<TR><TD>Listener Peak: </TD><TD>".$peak."</TD></TR>";
echo 
"<TR><TD>Supported Listeners: </TD><TD>".$max."</TD></TR>";
echo 
"<TR><TD>Unique Listeners: </TD><TD>".$unique."</TD></TR>";
echo 
"<TR><TD>Stream Bitrate: </TD><TD>".$bitrate." kbps</TD></TR>";
echo 
"<TR><TD>Current Song: </TD><TD>".$song."</TD></TR>";
//stop editing from here

echo "</TABLE>";
}
?>
See result here: http://radio.webcast.ro/tools/7.php
WEBcast is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump