Radyoda Çalan Şarkıyı Gösterme |
12 Mesajlar | 4.470 Okunma |
function filitre($q) {
$q = str_replace("`","",$q);
$q = str_replace("&","",$q);
$q = str_replace("%","",$q);
$q = str_replace("'","",$q);
$q = str_replace("<","",$q);
$q = str_replace(">","",$q);
$q = str_replace("Ö","O",$q);
$q = str_replace("ö","o",$q);
$q = str_replace("S","S",$q);
$q = str_replace("s","s",$q);
$q = str_replace("Ü","U",$q);
$q = str_replace("ü","u",$q);
$q = str_replace("G","G",$q);
$q = str_replace("g","g",$q);
$q = str_replace("I","I",$q);
$q = str_replace("i","i",$q);
$q = str_replace("Ç","C",$q);
$q = str_replace("ç","c",$q);
$q=trim($q);
return $q;
}
?>
$station_name = "Radio Station Name";
$refresh = "60"; // Page refresh time in seconds. Put 0 for no refresh
$timeout = "1"; // Number of seconds before connecton times out - a higher value will slow the page down if any servers are offline
/* ----------- Server configuration ---------- */
// Note: dont include http://
// Main server: The song title will be taken from this server
$ip[1] = "yayin.damarfm.com";
$port[1] = "8080";
/* Relays: Below you can enter more relays / restreams / channels / competitors or anything else */
/* ----- No need to edit below this line ----- */
/* ------------------------------------------- */
$servers = count($ip);
?>
if ($refresh != "0")
{
print "\n";
}
print "$Radyomuzdaki Dinleyici Sayisi \n";
?>
$i = "1";
while($i<=$servers)
{
$fp = @fsockopen($ip[$i],$port[$i],$errno,$errstr,$timeout);
if (!$fp)
{
$listeners[$i] = "0";
$msg[$i] = "ERROR [Connection refused / Server down]";
$error[$i] = "1";
}
else
{
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace('', "", $info);
$info = str_replace('', "", $info);
$stats = explode(',', $info);
if (empty($stats[1]) )
{
$listeners[$i] = "0";
$msg[$i] = "ERROR [There is no source connected]";
$error[$i] = "1";
}
else
{
if ($stats[1] == "1")
{
$song[$i] = $stats[6];
$filitrele[$i]= filitre($song[$i]);
$listeners[$i] = $stats[0];
$max[$i] = $stats[3];
$bitrate[$i] = $stats[5];
$peak[$i] = $stats[2];
if ($stats[0] == $max[$i])
{
}
}
{
$listeners[$i] = "0";
$msg[$i] = " ERROR [Cannot get info from server]";
$error[$i] = "1";
}
}
}
$i++;
}
print " Sanatci ismi: $filitrele[$i] ";
?>