Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
<?php
## shoutcasthack by bikky on ##
$server = "deinserver.de";
$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);
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";
$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;
}
## output on ##
echo '<html><title>Shoutcasthack by bikky</title><body>';
echo 'Anzahl der hoerer: ' . $shoutcast_currentlisteners . '<br />';
echo 'Bitrate: ' . $shoutcast_bitrate .'kb/s <br />';
echo 'Zuhoerer Peak: ' . $shoutcast_peaklisteners . '<br />';
echo 'Maximale Zuhoerer: ' . $shoutcast_maxlisteners . '<br />';
echo 'Aktueller Song: >>' . $shoutcast_cursong . '<< <br />';
echo '</body></html>';
## output off ##
## shoutcasthack by bikky off ##
?>
<?php
## shoutcasthack by bikky on ##
$server = "deinserver.de"; //hier deinen server eintragen z.b. musik.de oder 213.61.885.8
$port = 8000; //hier den port eintragen (ist standart 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);
fclose($fp);
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);
$numbers = explode(",", $page);
$shoutcast_currentlisteners = $numbers[0]; //variable ueber die aktuelle anzahl der zuhoerer
$connected = $numbers[1]; //variable zum anzeigen ob ein sender verbunden sind
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 = $numbers[2]; //variable die die anzahl der peaks angiebt
$shoutcast_maxlisteners = $numbers[3]; //variable ueber die maximal moegliche anzahl der zuhoerer
$shoutcast_reportedlisteners = $numbers[4]; //
$shoutcast_bitrate = $numbers[5]; //bitrate ;)
$shoutcast_cursong = $numbers[6]; //aktueller song
$shoutcast_curbwidth = $shoutcast_bitrate * $shoutcast_currentlisteners; //gesamtbandbreite
$shoutcast_peakbwidth = $shoutcast_bitrate * $shoutcast_peaklisteners; //gesamtpeakbandbreite
}
## output on ##
echo '<html><title>Shoutcasthack by bikky</title><body>';
if ($radio_status == 1) {
echo 'Anzahl der hoerer: ' . $shoutcast_currentlisteners . '<br />';
echo 'Gesamtbandbreite: ' . $shoutcast_curbwidth . ' kb/s<br />';
echo 'Bitrate: ' . $shoutcast_bitrate .' kb/s <br />';
echo 'Zuhoerer Peak: ' . $shoutcast_peaklisteners . '<br />';
echo 'Bandbreite Peak: ' . $shoutcast_peakbwidth . ' kb/s<br />';
echo 'Max. moegliche Zuhoerer: ' . $shoutcast_maxlisteners . '<br />';
echo 'Aktueller Song: >>' . $shoutcast_cursong . '<< <br />';
}
else {
echo '<h1>Sorry aber das radio ist zur zeit offline!</h1>';
}
echo '</body></html>';
## output off ##
## shoutcasthack by bikky off ##
?>
Original von Digi
bikmaek, gute Script. Mich interessiert, wie du da vorgegangen bist. Paket abgefangen oder bei google gesucht, oder doch anders?
<?php
function shoutcast_info($file, $port, $pass, $item, $quantity=10) {
$fp = @fsockopen ($file, $port, &$errno, &$errstr, 5);
if (!$fp) {
return 0;
} else {
fputs($fp, "GET /admin.cgi?pass={$pass}&mode=viewxml HTTP/1.1\r\n"
."User-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while (!feof($fp)) {
$xml .= fgets($fp,1024);
}
fclose($fp);
if (is_array($item)) {
$return_r = array();
foreach ($item as $value) {
preg_match("/\<".$value."\>(.*?)\<\/".$value."\>/si", $xml, $return);
$tempArray = array( $value => $return[1]);
$return_r = array_merge($return_r, $tempArray);
}
return $return_r;
}
if ($item == "playlist") {
$return_r = array();
preg_match_all("/\<SONG\>(.*?)\<\/SONG\>/si", $xml, $results);
for($i=0; $i<$quantity && $i<count($results[1]);$i++) {
preg_match("/\<PLAYEDAT\>(.*?)\<\/PLAYEDAT\>/si", $results[1][$i], $date);
preg_match("/\<TITLE\>(.*?)\<\/TITLE\>/si", $results[1][$i], $title);
$date = $date[1];
$title = $title[1];
$return_r[] = date("G:i:s", $date)." ".$title;
}
return $return_r;
} else {
preg_match("/\<".$item."\>(.*?)\<\/".$item."\>/si", $xml, $return);
return $return[1];
}
}
}
$item = array('streamstatus',
'servergenre',
'currentlisteners'
'bitrate');
$value = shoutcast_info("streamurl", "streamport", "streampass", $item);
if ($value[streamstatus] == 0) {
echo "<center />Webradio offline";
} else {
echo "<center />Webradio online<br />\n
Zuhörer: {$value[currentlisteners]}<br />\n";
Aktuelles Genre: {$value[servergenre]}<br />n";
Song: {$value[currentsong]}<br />\n";
DJ: {$value[servertitle]}<br />n";
Bitrate: {$value[bitrate]}<br />\n";
}
?>
$scip = "xxx.xxx.xxx.xxx"; // ip or url of shoutcast server
$scport = "12345"; // port of shoutcast server
$scpass = "xxx"; // password to shoutcast server
$scfp = @fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
}
if($scsuccs!=1){
fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
while(!feof($scfp)) {
$page .= fgets($scfp, 1000);
}
$loop = array("HOSTNAME");
$y=0;
while($loop[$y]!=''){
$pageed = ereg_replace(".*<$loop[$y]>", "", $page);
$scphp = strtolower($loop[$y]);
$$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);
if($loop[$y]==HOSTNAME)
$$scphp = urldecode($$scphp);
$y++;
}
fclose($scfp);
}