PHP Kod:
<?php
//* ---------- General configuration ---------- */
$station_name = "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
//* ----------- ---------- */
if ($refresh != "0")
{
print "<meta http-equiv=\"refresh\" content=\"$refresh\">\n";
}
print "<title>$station_name SHOUTcast Stats</title>\n";
?>
<?php
// user-configurable var: Shoutcast server URL
$shoutcast_url = 'https://feelo.80.yayin.com.tr';
error_reporting(0);
ini_set('user_agent', 'Mozilla');
header('Content-type: text/plain; charset=utf-8');
$html = file_get_contents(rtrim($shoutcast_url, '/').'/played.html');
$dom = new domDocument;
$dom->loadHTML($html);
$tables = $dom->getElementsByTagName('table');
$rows = $tables->item(2)->getElementsByTagName('tr');
foreach($rows as $row)
{
$cols = $row->getElementsByTagName('td');
if(!strstr($cols->item(0)->nodeValue,'@'))
{
echo $cols->item(0)->nodeValue . ': ';
echo $cols->item(1)->nodeValue;
if($cols->item(2)->nodeValue)
echo '*'.$cols->item(2)->nodeValue.'*';
echo "\n";
}
}
?>