Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Display listenrs on webpage

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Tue Oct 16, 2007 12:08 am    Post subject: Display listenrs on webpage Reply with quote

Hello

I'd like to display the number of listeners for individual mountpoints on a webpage

Can some help with a php script that will allow me to do this?

Thanks
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Oct 16, 2007 12:49 am    Post subject: Reply with quote

Those stats are available from the webroot xsl pages, you can create a modified status.xsl that only shows the mountpoint and listener count.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Tue Oct 16, 2007 2:22 am    Post subject: Reply with quote

I wonder if you could give me a hint as to how to do that. I'm very new to all this stuff.

Thanks
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Oct 16, 2007 3:11 am    Post subject: Reply with quote

just copy the status.xsl to some other filename ending in .xsl then edit with any editor, remove the stuff you are not interested in. Make it easy for you to parse.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Tue Oct 16, 2007 1:16 pm    Post subject: Reply with quote

karlH

Thanks for your help with this. I did find this code, and it works well to display the total connections to icecast:

Code:
<?php
$stats= @file_get_contents('http://admin:xxxxxx@xxxxx.com:8000/admin/stats');
if (preg_match('/<clients>([0-9]*)<\/clients>/', $stats, $regs)) {
   $listeners = intval($regs[1]);
} else {
   die("Error parsing stats");
}

echo "Total connections:" . $listeners;
?>


However, I've struggled unsuccessfully to display the listeners on a webpage at each individual mount point. Can you (or someone) show me how to modify the code above to display the total listeners (for example) at mount "/police"?

Thanks again
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
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 © 2001, 2002 phpBB Group
subRebel style by ktauber