1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<div id="tab">
<?php
$server = "localhost";
$port = "8000";
$fp = @fsockopen($server, $port, $errno, $errstr, 30);
if ($fp):
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)):
$page .= fgets($fp, 1000);
ENDWHILE;
fclose($fp);
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);
$numbers = explode(",", $page);
$shoutcast_currentlisteners = $numbers[0];
$connected = $numbers[1];
if($connected == 1):
$radio_status = 1;
$wordconnected = "yes";
else:
$wordconnected = "no";
ENDIF;
$shoutcast_peaklisteners = $numbers[2];
$shoutcast_maxlisteners = $numbers[3];
$shoutcast_reportedlisteners = $numbers[4];
$shoutcast_bitrate = $numbers[5];
$shoutcast_cursong = $numbers[6];
$shoutcast_curbwidth = $shoutcast_bitrate * $shoutcast_currentlisteners;
$shoutcast_peakbwidth = $shoutcast_bitrate * $shoutcast_peaklisteners;
ENDIF;
function suppr_accents($str, $encoding='windows-1252')
{
$str = htmlentities($str, ENT_NOQUOTES, $encoding);
$str = preg_replace('#&([A-za-z])(?:acute|grave|cedil|circ|orn|ring|slash|th|tilde|uml);#', '\1', $str);
$str = preg_replace('#&([A-za-z]{2})(?:lig);#', '\1', $str);
$str = preg_replace('#&[^;]+;#', '', $str);
return $str;
}
$shoutcast_cursong_l = suppr_accents($shoutcast_cursong);
?>
<H1>Information sur le Flux Radio</H1>
<?PHP
if ($radio_status == 1):
echo '<UL>
<LI>Titre en cours : <b>'.$shoutcast_cursong_l.'</b>.</LI>
<LI>Nombre de connectés : <b>' . $shoutcast_currentlisteners . '</b> auditeurs, sur '.$shoutcast_maxlisteners.' autorisés.</LI>
<LI>Pic d\'audiance : <B>'.$shoutcast_peaklisteners.'</B> auditeurs.</LI>
<LI>Qualité du stream : <b>' . $shoutcast_bitrate . '</b> Kbps.</LI>
</UL>';
else:
echo '<P><B>Le flux de la radio n\'est actuellement pas disponible.</B><BR />
Veuillez consulter notre site web plus plus emples informations !!!</P>';
ENDIF;
?>
</div>
<script>
setInterval(function(){
$('#tab').load('InfoShoutcast.php').fadeIn("slow");
}, 1000);
</script> |
Partager