- Status de rádio 04.08.15 6:53
Olá gente, eu estou a ver hosts que suportem a página status.php (a hostinger não suporta). De momento estou a tentar na 10xhost mas aparece uns erros (mensagem no fim do tópico).. Já tentei com a da vibe e da kihabbo, mas n vai... Até procurei um, mas esse também n dá. Por isso, preciso de um código de status de rádio.
O último código que usei:
- Código:
Warning: fsockopen(): unable to connect to 198.50.197.30:9998 (Connection timed out) in ... on line 5
Warning: fsockopen(): unable to connect to 198.50.197.30:9998 (Connection timed out) in ... on line 27
MySQL server has gone away
O último código que usei:
- Código:
<?
$host = "198.50.197.30";
$port = "9998";
$listenlink = 'http://198.50.197.30:9998/listen.pls'; //make link to stream
$fp = fsockopen("$host", "$port"); //open connection
if(!$fp) {
$success=2; //se-t if no connection
}
if($success!=2){ //if connection
fputs($fp,"GET /index.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //get 7.html
while(!feof($fp)) {
$pg .= fgets($fp, 1000);
}
fclose($fp); //close connection
$paage = ereg_replace(".*<font class=default>Stream Title: </font></td><td><font class=default><b>", "", $pg); //extract data
$paage = ereg_replace("</b></td></tr><tr><td width=100 nowrap>.*", "", $paage); //extract data
$pge = ereg_replace(".*<font class=default>Stream Genre: </font></td><td><font class=default><b>", "", $pg); //extract data
$pge = ereg_replace("</b></td></tr><tr><td width=100 nowrap>.*", "", $pge); //extract data
$pe = ereg_replace(".*<font class=default>Stream Genre: </font></td><td><font class=default><b>", "", $pg); //extract data
$pe = ereg_replace("</b></td></tr><tr><td width=100 nowrap>.*", "", $pe); //extract data
$musica = ereg_replace(".*<font class=default>Current Song: </font></td><td><font class=default><b>", "", $pg); //extract data
$musica = ereg_replace("</b></td></tr></tab[b][/b]le>.*", "", $musica); //extract data
$numbers = explode(",",$paage); //extract data
$servertitle=$numbers[0]; //set variable
$connected=$numbers[1]; //set variable
}
$fp2 = fsockopen("$host", $port); //open connection
if(!$fp2) {
$success2=2; //se-t if no connection
}
if($success2!=2){ //if connection
fputs($fp2,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //get 7.html
while(!feof($fp2)) {
$pg2 .= fgets($fp2, 1000);
}
fclose($fp2); //close connection
$pag = ereg_replace(".*<body>", "", $pg2); //extract data
$pag = ereg_replace("</body>.*", ",", $pag); //extract data
$numbers = explode(",",$pag); //extract data
$currentlisteners=$numbers[0]; //set variable
}
?>