Radyoda Çalan Şarkıyı Gösterme |
12 Mesajlar | 4.474 Okunma |
/*
Live SHOUTcast statistics for multiple servers
This script is (C) MixStream.net 2006
If you use this script, please leave the copyright
notice and link at the bottom of the page or link
to mixstream.net somewhere on your website. Feel
free to modify it in any other way to suit your needs.
Version: v1.0
*/
/* ---------- General configuration ---------- */
$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];
$listeners[$i] = $stats[0];
$max[$i] = $stats[3];
$bitrate[$i] = $stats[5];
$peak[$i] = $stats[2];
if ($stats[0] == $max[$i])
{
$msg[$i] .= "";
}
$msg[$i] .= "Server is up at $bitrate[$i] kbps with $listeners[$i] of $max[$i] listeners";
if ($stats[0] == $max[$i])
{
$msg[$i] .= "";
}
$msg[$i] .= "\n Radyo 2011 en cok dinleyici sayisi: $peak[$i]";
}
else
{
$listeners[$i] = "0";
$msg[$i] = " ERROR [Cannot get info from server]";
$error[$i] = "1";
}
}
}
$i++;
}
$total_listeners = array_sum($listeners) ;
print "
\n \n Radyo2011 Simdiki Dinleyici Sayisi $total_listeners
\n \n\n\n \n sanatci ismi: $song[1]
\n \n\n\n";
$i = "1";
while($i<=$servers)
{
print " \n";
if ($max[$i] > 0)
{
$percentage = round(($listeners[$i] / $max[$i] * 100));
$timesby = (300 / $max[$i]);
$barlength = round(($listeners[$i] * "$timesby"));
}
if ($error[$i] != "1")
{
?>
" target="_blank">Server
bar.gif" width="" height="12" alt="The server is at % capacity">
0%
50%
100%
}
else
{
?>
" target="_blank">Server
0%
50%
100%
}
print " Status: $msg[$i]
\n \n \n";
$i++;
}
print "\n";
$time_difference = "0"; // BST: 1 GMT: 0
$time_difference = ($time_difference * 60 * 60);
$time = date("h:ia", time() + $time_difference);
$date = date("jS F, Y", time() + 0);
print "\n \n Live SHOUTcast statistics: $date, $time
\n \n\n";
?>