basti1077
Mitglied
Dabei seit: 09.08.06
Beiträge: 12
|
|
Hallo zusammen
Ich suche ein Script mit dem ich von einem Shoutcast Server die Titel abgreifen kann die dann als Lauftext angezeigt werden.
Ich habe zwar eins aber ich komme mit dem Umbau nicht klar.
Sobald ich es in diesen Code einbinden möchte geht es nicht mehr.
<html>
<title></title><script>
var tt=0;
warten();
function warten()
{
if (tt!=0)
location.reload();
tt++;
}
</script>
<body onLoad="setTimeout('warten()', 200000);" bgcolor="black" text="#FFCC00" link="blue" vlink="purple" alink="red">
<body bgcolor="black" text="#FFCC00" link="blue" vlink="purple" alink="red">
<p align="center"> <font size="1" color="#FFCC00"> Es sendet: </font><font size="2"></font></p>
<p align="center"> <img src="sendeplan/image.php"></p>
<p align="center"> <font size="1" color="#FFCC00">Aktueller Titel:</font><br>
__________________</p>
<p align="center"><U><b><font size="2" color="yellow">Helloradio hören:</font></b></U></p>
<table border="0" width="15%" align="center" height="35">
<tr>
<td width="432" height="9">
<p align="center"><a href="http://people.freenet.de/helloradio/helloradio.asx" target="_top"><img src="http://www.helloradio24.de/btn_wmp.gif" width="88" height="31" border="0"></a></p>
</td>
</tr>
<tr>
<td width="432" height="9">
<p align="center"><a href="http://s3.pop-stream.de:7410/listen.pls" target="_top"><img src="http://www.helloradio24.de/winamp.gif" width="88" height="31" border="0"></a></p>
</td>
</tr>
<tr>
<td width="432" height="9">
<p align="center"><a href="http://www.helloradio24.de/7410.ram" target="_top"><img src="http://www.helloradio24.de/real-player.gif" width="88" height="31" border="0"></a></p>
</td>
</tr>
</table>
<p align="center">__________________</p>
<p align="center"><U><b><font size="2" color="yellow">Helloradio Chat</font></b></U></p>
<p align="center"><a href="http://www.bbg-party.de/chat/index.htm" target="_blank"><img src="http://www.bbg-party.de/events/boxen/chat.jpg" border="0"></a></p>
</body>
</html>
Unter aktueller Titel müste das eigentlich rein.
<?php
include('config_radio.php');
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' is Offline';
}
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("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "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 || $loop[$y]==SERVERTITLE)
$$scphp = urldecode($$scphp);
$y++;
}
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$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]);
$dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
$dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
fclose($scfp);
}
if($streamstatus == "1"){
echo'
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel=stylesheet href="" type="text/css">
<title>'.$scdef.'</title>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p><font size="2" color="white"
<p align="center"><center>
<b></b> '.$song[0].'</p><b>
</p>
</body>
</html>';
}
if($streamstatus == "0")
{
echo'
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel=stylesheet href="" type="text/css">
<title>Streamserver ist offline</title>
</head>
<body text="" bgcolor="">
<center>
<img src="offline.jpg">
</body>
</html>';
}
?>
Leider funktioniert es nicht so wie es soll.
Kann mir da mal bitte jemand helfen.
Die Anzeige funktioniert soweit Online wenn ich den letzten Code einzeln hoch lade.
Gruss Basti
|
|