| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Tue Oct 16, 2007 12:08 am Post subject: Display listenrs on webpage |
|
|
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

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Tue Oct 16, 2007 12:49 am Post subject: |
|
|
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 |
|
 |
Anonymous Guest
|
Posted: Tue Oct 16, 2007 2:22 am Post subject: |
|
|
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

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Tue Oct 16, 2007 3:11 am Post subject: |
|
|
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 |
|
 |
Anonymous Guest
|
Posted: Tue Oct 16, 2007 1:16 pm Post subject: |
|
|
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 |
|
 |
|