I found it! here's the script to get information about the Shoutcast Server:
Code: Select all
<pre>
<?php
$fp = @fsockopen("127.0.0.1", 8000, $errno, $errstr, 30);
if($fp) {
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Reader(Mozilla Compatible)\r\n\r\n");
while(!feof($fp)) {
$dataset .= fgets($fp, 1000);
}
fclose($fp);
$dataset1 = $dataset;
$headerinfo = ereg_replace("<body>.*","",$dataset);
$dataset = ereg_replace(".*<body>", "", $dataset);
$dataset = ereg_replace("</body>.*", ",", $dataset);
$entries = explode(",",$dataset);
$listener=$entries[0];
$status=$entries[1];
$listenerpeak = $entries[2];
$maxlisteners=$entries[3];
$totallisteners=$entries[4];
$bitrate=$entries[5];
$songtitel=$entries[6];
}
print_r($entries);
?></pre>
0 is total listeners (total users connected at the moment)
1 is the status(which i guess 0 for offline, and 1 for online)
2 is listener peak (max users connected at the same time
3 is maximun listeners at a time
4 is unique listeners(two connections to server with same ip)
5 is the bitrate in kbps
6 is the artist name plus title name (ex.: Chad Kroeger - Hero)
7 is empty... doesn't contain anything, but i don't know if it will change