Location: PHPKode > projects > phpSC > addons/stats/scastxml_var.php
<?
//include ("config.php");
$host = "127.0.0.1";
$port = "8000";
$listenlink = 'http://'.$host.':'.$port.'/listen.pls';  //make link to stream
$fp = @fsockopen("$host", $port); //open connection
if(!$fp) {
	$success=2;  //set if no connection
}
if($success!=2){ //if connection
 fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: phpSC Plus: Stats (Mozilla Compatible)\r\n\r\n"); //get 7.html
 while(!feof($fp)) {
  $page .= fgets($fp, 1000);
 }
 @fclose($fp); //close connection
 $page = ereg_replace(".*<body>", "", $page); //extract data
 $page = ereg_replace("</body>.*", ",", $page); //extract data
 $numbers = explode(",",$page); //extract data
 $currentlisteners=$numbers[0]; //set variable
 $connected=$numbers[1]; //set variable

 if($connected==1) //if DSP is connected
  $wordconnected="yes"; //set variable
 else //if no DSP connection
  $wordconnected="no"; //set variable
 $peaklisteners=$numbers[2]; //set variable
 $maxlisteners=$numbers[3]; //set variable
 $reportedlisteners=$numbers[4]; //set variable
 }
?>
Return current item: phpSC