Script de Música - O que está a tocar no momento? imprimir

  • 1

Coloque no seu site qual música que está a tocar no momento, seja Ao Vivo ou Programação Auto DJ

 

Nome do ficheiro: script_stats.php







<?
###################################################
# WHMSonic Live Radio Configurations              #
# Support: admin@whmsonic.com / www.whmsonic.com  #
###################################################

//================================================
### DETALHES REQUERIDOS - SÓ EDITE ESTA PARTE
//================================================
//*****************************************//
$scip 	= "COLOQUE-AQUI";	// IP DA SUA RÁDIO
$scport = "COLOQUE-AQUI"; 	// PORTA DA SUA RÁDIO
$scpass = "COLOQUE-AQUI";	// SENHA DA SUA RÁDIO
//*****************************************//


// NÃO EDITA NADA A PARTIR DAQUI ==========================================

$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 5);
 if(!$scfp) {
  $scsuccs=1;
  echo "$errno
"; echo "$errstr"; exit; } 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); } ###################################################################################################################### /////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //define xml elements $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE"); $y=0; while($loop[$y]!=''){ $pageed = ereg_replace(".*<$loop[$y]>", "", $page); $scphp = strtolower($loop[$y]); $$scphp = ereg_replace(".*", "", $pageed); if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE) $$scphp = urldecode($$scphp); // uncomment the next line to see all variables //echo'$'.$scphp.' = '.$$scphp.'
'; $y++; } //end intro xml elements ###################################################################################################################### ###################################################################################################################### /////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //get song info and history $pageed = ereg_replace(".*", "", $page); $pageed = ereg_replace(".*", "", $pageed); $songatime = explode("", $pageed); $r=1; while($songatime[$r]!=""){ $t=$r-1; $playedat[$t] = ereg_replace(".*", "", $songatime[$r]); $playedat[$t] = ereg_replace(".*", "", $playedat[$t]); $song[$t] = ereg_replace(".*", "", $songatime[$r]); $song[$t] = ereg_replace(".*", "", $song[$t]); $song[$t] = urldecode($song[$t]); $dj[$t] = ereg_replace(".*", "", $page); $dj[$t] = ereg_replace(".*", "", $pageed); $r++; } //end song info fclose($scfp); } ?>

Esta resposta lhe foi útil?

« Retornar