<?php
## shoutcasthack by bikky on ##
#
# Version: 0.5 @ 2008-08-03
# - readable output
# - XHTML 1.0 Strict
#
if ($_REQUEST['url'] && $_REQUEST['port']) {
$port = $_REQUEST['port'];
$server = $_REQUEST['url'];
} else {
$port = ''; //hier alternativ deinen server eintragen z.b. musik.de oder 213.61.885.8
$server = ''; //hier alternativ den port eintragen (standard: 8000)
}
echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n";
echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
if ($port == '' || $server == '') {
echo ' <head>' . "\n";
echo ' <title>Shoutcasthack by bikky</title>' . "\n";
echo ' </head>' . "\n";
echo ' <body>' . "\n";
echo ' <h1>ES FEHLEN DATEN!</h1>' . "\n";
echo ' </body>' . "\n";
echo '</html>' . "\n";
} else {
$playlist = 'http://' . $server . ':' . $port . '/listen.pls';
$filepointer = @fsockopen($server, $port, $errno, $errstr, 30);
if ($filepointer) {
fputs($filepointer, "GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($filepointer)) {
$page .= fgets($filepointer, 1000);
}
fclose($filepointer);
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);
$content = explode(",", $page);
$shoutcast_currentlisteners = $content[0]; //variable ueber die aktuelle anzahl der zuhoerer
$connected = $content[1]; //variable zum anzeigen ob ein sender verbunden ist
if($connected == 1) {
$radio_status = 1; //variable zum anzeigen ob radio an ist oder nicht
$wordconnected = "yes"; //zusaetzliche variable die ich brauchte ;)
} else {
$wordconnected = "no"; //zusaetzliche variable die ich brauchte
}
$shoutcast_peaklisteners = $content[2]; //variable die die anzahl der peaks angiebt
$shoutcast_maxlisteners = $content[3]; //variable ueber die maximal moegliche anzahl der zuhoerer
$shoutcast_reportedlisteners = $content[4]; //
$shoutcast_bitrate = $content[5]; //bitrate ;)
$shoutcast_cursong = $content[6]; //aktueller song
$shoutcast_testvat = $content[7]; // testvariable
$shoutcast_curbwidth = $shoutcast_bitrate * $shoutcast_currentlisteners; //gesamtbandbreite
$shoutcast_peakbwidth = $shoutcast_bitrate * $shoutcast_peaklisteners; //gesamtpeakbandbreite
}
## output on ##
echo ' <head>' . "\n";
echo ' <title>Shoutcasthack by bikky</title>' . "\n";
echo ' </head>' . "\n";
echo ' <body>' . "\n";
if ($radio_status == 1 && $server != '' && $port != '') {
echo ' <p>Hier kannst du hoeren: <a href="' . $playlist . '">' . $playlist . '</a><br />' . "\n";
echo ' Anzahl der hoerer: ' . $shoutcast_currentlisteners . '<br />' . "\n";
echo ' Gesamtbandbreite: ' . $shoutcast_curbwidth . ' kb/s<br />' . "\n";
echo ' Bitrate: ' . $shoutcast_bitrate .' kb/s <br />' . "\n";
echo ' Zuhoerer Peak: ' . $shoutcast_peaklisteners . '<br />' . "\n";
echo ' Bandbreite Peak: ' . $shoutcast_peakbwidth . ' kb/s<br />' . "\n";
echo ' Max. moegliche Zuhoerer: ' . $shoutcast_maxlisteners . '<br />' . "\n";
echo ' Aktueller Song: "' . $shoutcast_cursong . '"</p>' . "\n";
} else {
echo ' <h1>Sorry aber das radio ist zur zeit offline!</h1>' . "\n";
echo ' <p>Server: "' . $server . '"<br />' . "\n";
echo ' Port: "' . $port . '"</p>' . "\n";
}
echo ' </body>' . "\n";
echo '</html>' . "\n";
}
## output off ##
## shoutcasthack by bikky off ##
?>