acho que esse script deve ajudar com status:
<?php
//Configuration
$streaming = http://www.criawebs.com.br
$scdef = "Radio"; // Default station name to display when server or stream is down
$scip = ""; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = ""; // port of shoutcast server
$scpass = ""; // password to shoutcast server
//End configuration
$scfp = fsockopen("$scip","$scport");
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' Offline';
}
if($scsuccs!=1){
fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
while(!feof($scfp)) {
$page .= fgets($scfp, 1000);
}
$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS");
$y=0;
while($loop[$y]!=''){
$pageed = ereg_replace(".*<$loop[$y]>", "", $page);
$scphp = strtolower($loop[$y]);
$$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);
if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE)
$$scphp = urldecode($$scphp);
$y++;
}
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$r=1;
while($songatime[$r]!=""){
$t=$r-1;
$playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]);
$playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]);
$song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]);
$song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]);
$song[$t] = urldecode($song[$t]);
$dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
$dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
//end song info
fclose($scfp);
}
if($streamstatus == "1"){
?>
<a href="#" title="Atualizar Locutor" onclick="atualiza_dados('dj','http://habbix.com.br/stats/dj.php')"><font face="Verdana" size="1" color="ffffff"><? echo $servertitle; ?></font></a>
<?
}elseif($streamstatus == "0")
{
?>
<a href="#" title="Atualizar Locutor" onclick="atualiza_dados('dj','stats/dj')">Offline!</a>
<?
}else{
?>
<a href="#" title="Atualizar Locutor" onclick="atualiza_dados('dj','stats/dj')">Atualize...</a>
<?
}
?>
'유용한정보' 카테고리의 다른 글
BEST 음악방송 (0) | 2020.12.10 |
---|---|
SHOUTcast Stream Ripper (0) | 2016.02.15 |
SHOUTcast/Installation (0) | 2016.02.15 |
PhP script to parse Shoutcast metadata? (0) | 2016.02.09 |
PHP cURL to kick Shoutcast Source (0) | 2016.02.09 |
검색엔진 최적화. 꼭 알아야 할 HTTP 상태 코드 (0) | 2016.02.07 |
각종 확장자 파일모음 (0) | 2016.02.01 |
윈엠프 음악방송 유틸 모음 세팅을 한번에 (윈7,윈XP) (0) | 2015.11.21 |
댓글