 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
Cyberian75
Joined: 26 Sep 2002 Posts: 1052 Location: Oregon
|
Posted: Tue May 25, 2004 12:02 am Post subject: |
|
|
Try...
Code: |
<?php shoutcast("216.218.254.98", 8820, 1, 'on-air messege', 'off-air message'); ?>
|
_________________ Michael P. |
|
Back to top |
|
 |
Nokrosis
Joined: 23 May 2004 Posts: 11
|
Posted: Tue May 25, 2004 12:24 am Post subject: |
|
|
Ok, now it shows the online message only, even when i'm NOT streaming. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1052 Location: Oregon
|
Posted: Tue May 25, 2004 1:20 am Post subject: |
|
|
You've to reload the page to see the change or even re-launch the browser. And for the script to display the offline message, you'd have to completely shut the server down, because this script only checks to see if the IP address is reachable. _________________ Michael P. |
|
Back to top |
|
 |
Nokrosis
Joined: 23 May 2004 Posts: 11
|
Posted: Tue May 25, 2004 2:00 am Post subject: |
|
|
DAMN !!!!
I was looking for a script that tells me the status of the Streaming, not the Server status.
i want my Server to be online because there are many broadcasters, so each one streams individually, i need a script to show the streaming status, on air, and off air.
I know there's a way. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1052 Location: Oregon
|
Posted: Tue May 25, 2004 2:04 am Post subject: |
|
|
Try the Winamp forums... _________________ Michael P. |
|
Back to top |
|
 |
Nokrosis
Joined: 23 May 2004 Posts: 11
|
Posted: Tue May 25, 2004 2:18 am Post subject: |
|
|
Thanx |
|
Back to top |
|
 |
INVERT3D
Joined: 09 Jun 2003 Posts: 9
|
Posted: Tue May 25, 2004 3:48 pm Post subject: |
|
|
I have a more full script...it shows more then just if the stream is up or down, if it is up it will show how many people are listening and some more stuff.
Code: |
<?php
$scdef = "radio name";
$scip = "ip";
$scport = "port";
$scpass = "password";
$scfp = @fsockopen("$scip", $scport, &$errno, &$errstr, 3);
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);
}
//define xml elements
$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS");
$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);
// uncomment the next line to see all variables
//echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
//end intro xml elements
//get song info and history
$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++;
}
//end song info
fclose($scfp);
}
//display stats
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
echo'
<b>'.$servertitle.' System Stats</b><br><br>
<b>Current Listeners: </b>'.$currentlisteners.' / 32<br>
<b>Current Song:</b> '.$song[0].'<br><br>
<b>Past Songs:</b><br>
<b>1.</b> '.$song[1].'<BR>
<b>2.</b> '.$song[2].'<BR>
<b>3.</b> '.$song[3].'<BR>
<b>4.</b> '.$song[4].'<BR>
<b>5.</b> '.$song[5].'<BR>
<b>6.</b> '.$song[6].'<BR>
<b>7.</b> '.$song[7].'<BR>
<b>8.</b> '.$song[8].'<BR>
<b>9.</b> '.$song[9].'<BR>
<BR>';
}
?>
|
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2 © 2001, 2002 phpBB Group
|