
Untitled
By: a guest on
Aug 8th, 2012 | syntax:
None | size: 1.01 KB | hits: 36 | expires: Never
<?php
////////////////////
// CONFIG AREA
// MAKE EDITS BELOW
///////////////////
//Enter your shoutcast 7.htm url
$sc_url_ip = "192.169.0.1"; // <= CHANGE THIS
//ex: 6x.3x.18x.14x
$sc_url_port = "8000"; // <= CHANGE THIS
//ex:8000
////////////////////
// END OF CONFIG AREA
//
// DO NOT EDIT BELOW
// UNLESS YOU KNOW WHAT YOU ARE DOING
////////////////////
function getNowPlaying($sc_url_ip,$sc_url_port)
{
$open = fsockopen($sc_url_ip,$sc_url_port,$errno,$errstr,'.5');
if ($open) {
fputs($open,"GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n");
stream_set_timeout($open,'1');
$read = fread($open,200);
$text = explode(",",$read);
if($text[6] == '' || $text[6] == '</body></html>'){ $msg = ' live stream '; } else { $msg = $text[6]; }
$text = 'Now Playing ('.$src.'): '.$msg;
} else { return false; }
fclose($open);
return $text;
}
//////////////////
//get the now playing
$current_song = getNowPlaying($sc_url_ip,$sc_url_port);
print $current_song;
?>