boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SHOUTcast Status Script
Goto page Previous  1, 2
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
Cyberian75



Joined: 26 Sep 2002
Posts: 1052
Location: Oregon

PostPosted: Tue May 25, 2004 12:02 am    Post subject: Reply with quote

Try...

Code:

<?php shoutcast("216.218.254.98", 8820, 1, 'on-air messege', 'off-air message'); ?>

_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Nokrosis



Joined: 23 May 2004
Posts: 11

PostPosted: Tue May 25, 2004 12:24 am    Post subject: Reply with quote

Ok, now it shows the online message only, even when i'm NOT streaming.
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1052
Location: Oregon

PostPosted: Tue May 25, 2004 1:20 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Nokrosis



Joined: 23 May 2004
Posts: 11

PostPosted: Tue May 25, 2004 2:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1052
Location: Oregon

PostPosted: Tue May 25, 2004 2:04 am    Post subject: Reply with quote

Try the Winamp forums...
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Nokrosis



Joined: 23 May 2004
Posts: 11

PostPosted: Tue May 25, 2004 2:18 am    Post subject: Reply with quote

Thanx
Back to top
View user's profile Send private message
INVERT3D



Joined: 09 Jun 2003
Posts: 9

PostPosted: Tue May 25, 2004 3:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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