Mam takie radio
http://shout24.net:6969/listen.plsDla tego skryptu:
<?
class ShoutCAST {
var $host, $port, $pass, $dane, $values, $indexes;
function connect() {
$fp = fsockopen($this->host, $this->port, $errno, $errstr, 10
); if (!$fp) { return false;
} else {
fputs($fp, "GET /admin.cgi?pass=".$this->pass."&mode=viewxml HTTP/1.0rn"); fputs($fp, "User-Agent: Mozillarnrn"); $this->dane .= fgets($fp, 512
); }
if (stristr($this->dane, "HTTP/1.0 200 OK") != true) return false; $code_xml = xml_parser_create();
if (!xml_parse_into_struct($code_xml, $this->dane, $this->values, $this->indexes)) return false;
xml_parser_free($code_xml);
return true;
}
}
function showValue($which) {
return($this->values[$this->indexes[$which][0]]["value"]);
}
}
$shoutcast = new ShoutCAST();
$shoutcast->host = 'http://shout24.net'; // adres IP serwera
$shoutcast->port = '6969'; // port serwera
$shoutcast->passwd = 'haslo'; // hasło do serwera
if ($shoutcast->connect()) {
if ($shoutcast->showValue('STREAMSTATUS')) {
print 'Nazwa serwera:'.$shoutcast->showValue('SERVERTITLE').'<br>'; print 'Ilość słuchaczy:'.$shoutcast->showValue('CURRENTLISTENERS').'<br>'; print 'Limit słuchaczy:'.$shoutcast->showValue('MAXLISTENERS').'<br>'; print 'Rekord słuchaczy:'.$shoutcast->showValue('PEAKLISTENERS').'<br>'; print 'Rodzaj serwera:'.$shoutcast->showValue('SERVERGENRE').'<br>'; print 'URL serwera:'.$shoutcast->showValue('SERVERURL').'<br>'; print 'Nazwa piosenki:'.$shoutcast->showValue('SONGTITLE').'<br>'; print 'Jakość nadawania:'.$shoutcast->showValue('BITRATE').'<br>'; print 'IRC:'.$shoutcast->showValue('IRC').'<br>'; print 'AIM:'.$shoutcast->showValue('AIM').'<br>'; print 'ICQ:'.$shoutcast->showValue('ICQ').'<br>';
} else {
print "Serwer jest włączony, ale aktualnie nie ma żadnej audycji."; }
} else {
print 'Serwer jest wyłączony.'; }
?>
Pojawia się taki błąd:
Warning: fsockopen() [function.fsockopen]: unable to connect to
http://shout24.net:6969 (Unable to find the socket transport "http" - did you forget to enable it when you configured php?) in /home/ogien/public_html/poprosturadio/radio.php5 on line 7
Serwer jest wyłączony.
Co to oznacza? A konkretniej jak wobec tego dostać się do nformacji serwera shoutcast?