View Single Post
Old 24th October 2017, 11:57   #2
BeatFlexx
Junior Member
 
Join Date: Oct 2017
Posts: 10
This is the Script I'm using.

code:

<?php
error_reporting(0);

$scip = "xxx.xx.xxx.xx"; // Server IP
$scport = "POORT"; // Port
$scpass = "**********"; // Password
$scversion = "2"; // Shoutcast Version
$scID = "1"; // Server ID
$imgKey = "MYAPI"; // LastFM api to Get Images

$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo'Offline';
}
if($scsuccs!=1){

fputs ($scfp, "GET /admin.cgi?sid=$scID&pass=$scpass&mode=viewxml&page=4 HTTP/1.1\r\nHost: $scip:$scport\r\n .
User-Agent: User (Mozilla Compatible)\r\n .
Authorization: Basic ".base64_encode ("admin:$scpass")."\r\n\r\n");
while(!feof($scfp)) {
$page .= fgets($scfp, 1000);
}

$loop = array("STREAMSTATUS", "BITRATE");
$y=0;
while($loop[$y]!=''){
$pageed = ereg_replace(".*<$loop[$y]>", "", $page);
$scphp = strtolower($loop[$y]);
$$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);
if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE)
$$scphp = urldecode($$scphp);

$y++;
}

$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("</SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$a = 0;
$r=1;
while($songatime[$r]!=""){
$t=$r-1;
$playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]);
$playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]);
$song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]);
$song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]);
$song[$t] = urldecode($song[$t]);
list ($artiest, $titel) = explode(" - ", $song[$t]);
$rij_kleur = ($a++ % 2) ? "#f5f5f5" : "#e8e8e8";

$xml = simplexml_load_file("http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=$artiest&api_key=$imgKey");
$trackimg = $xml->artist->image[2];

if ($trackimg == "") {
$trackimg = "../noIMG.png";
}

if ($artiest == "LIVE" AND $titel == "-=ON AIR=-") {
$trackimg = "../live.jpg";
}

echo'<div style="background-color: '.$rij_kleur.';>
<p style="width: 65px;"><img style="margin-top:5px; margin-left:5px; border-radius: 100%; border: 1px solid #ff1190; width: 60px; height: 60px;" src="'.$trackimg.'" /></p>
<div style="display:block; margin: -66px 0px 0px 80px; float:left;">
<i class="fa fa-microphone"></i> <strong>'.$artiest.'</strong><br />
'.$titel.'</a>
</div></div>';

$r++; }
fclose($scfp);
}
?>



It always worked before.
I'm even getting a HTTP ERROR 500
BeatFlexx is offline   Reply With Quote