<div id="SRwidget"></div> 
<script type="text/javascript" src="http://widgets.serverroom.us/SHOUTinfo/basic.js"></script> 
<script type="text/javascript"> var Config = { "Station" : "radiohiphop.serverroom.us:5234", "StationTitle": "Server Room Station", "BoxStyle" : "green", "nowplaying":"1", "ShowListeners" : "1", "width" : "300", "height" : "150", "bgcolor" : "#CCCCCC", "nowplayingcolor" : "#FF0000", "copyright" : "1", "playlistheight" : "150", "songslist" : "1", "ap64" : "wqsthsimoorkramrevres4w2", "timezone":"GMT-5", "DomainName":"serverroom.us" }; GenerateWidget(Config); </script>

<?
 ############################################################
# get shoucast information
# www.serverroom.us script
############################################################

# NOTE: in order to work, this script requires to have allow_url_fopen = On in apache configuration
# to include this script somewhere on your webpage just type include ("shoutinfo.php"); in your php script
# modify the variable bellow with your stream information.

# $StationURL must be a station url or a IP address.
# The IP address is subject of change so it's better to use the hostname.
# $Port is a 4 digits number

# Start Config
$StationURL = "radiohiphop.serverroom.us"; // the IP or Hostname for the SHOUTcast station
$Port = "5234"; // the Port number, 4 digits
$StationOfflineMessage = "RADIOHIPHOP.com is currently offline.";
# End Config

if (strlen($Port)!=4 || !intval($Port)) die("Wrong Port");


function ReturnShoutcastArray($IP,$Port)
{
$SH = fsockopen($IP, $Port, $errno, $errstr, 30);
echo $errstr;
if ($SH)
{
fputs($SH,"GET /7.html HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
$content = "";
while(!feof($SH))
{ $content .= fgets($SH, 1000);
}
fclose($SH);
$content = strstr($content,"");
$content = str_replace("</body></html>","",$content);
$InfoArray = split("[,]",$content);
return array($InfoArray[0],$InfoArray[1],$InfoArray[2],$InfoArray[3],$InfoArray[4],$InfoArray[5],$InfoArray[6]);
}
else
{
return array(0,0,0,0,0,0,0);
}
}


list($CurrListeners,$Status,$Peak,$MaxListeners,$Unique,$Bitrate,$SongTitle) = ReturnShoutcastArray($StationURL,$Port);

# if $Status = 0 you are not streaming. print the $StationOfflineMessage and then die.

if (!$Status)
{
echo $StationOfflineMessage;
die();
}

# if the script gets here, do everything you want with the variables.
# variable definitions
# $SongTitle - the current name of the song, including artist.
# $Bitrate - current bitrate for the stream
# $CurrListeners - total number of listeners online
# $Unique - total number of unique listeners online
# $Peak - maximum number of listeners ever

# HERE IS WHAT YOU NEED TO CHANGE
# -------------------------------
echo "Now Playing: $SongTitle at $Bitrate kbps <br />";
echo "Listeners Online: $CurrListeners ($Unique are unique)";
?>