Ross Levis
2011-May-13 00:48 UTC
[Icecast] Standard method to read current listeners without user/password
Is there a standard method to read the current number of listeners from an icecast2 server without knowing the admin user/password? We produce radio broadcasting/streaming software for Windows which can show the current number of listeners. Many Icecast hosting companies won't provide the admin password as they have lots of other customers using the same server, so the software doesn't have access to the stats.xml. I'm guessing there isn't any other built-in method, in which case we would have to suggest the customer switches to a Shoutcast server which is disappointing. Regards, Ross. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast/attachments/20110513/6e2ebaa2/attachment.htm
josh at thepruitts.org
2011-May-13 01:55 UTC
[Icecast] Standard method to read current listeners without user/password
There is a file /status.xsl that contains all the status information for your server. For example, mine: http://radio.foxcub.net:8000/status.xsl You can either parse it with your favorite x?l parsing library or scrape it for listener info. You can see an example of this in action at my page: http://radio.foxcub.net It shows number of listeners and song playing. Josh On 05/12/2011 05:48 PM, Ross Levis wrote:> > Is there a standard method to read the current number of listeners > from an icecast2 server without knowing the admin user/password? > > We produce radio broadcasting/streaming software for Windows which can > show the current number of listeners. Many Icecast hosting companies > won't provide the admin password as they have lots of other customers > using the same server, so the software doesn't have access to the > stats.xml. > > I'm guessing there isn't any other built-in method, in which case we > would have to suggest the customer switches to a Shoutcast server > which is disappointing. > > Regards, > > Ross. > > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-- -- "Everyone is a genius but if you judge a fish by its ability to climb a tree it will spend its whole life believing it is stupid." - Albert Einstein -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast/attachments/20110512/8409f7bf/attachment.htm
Ross Levis
2011-May-13 02:40 UTC
[Icecast] Standard method to read current listeners without user/password
I see, so basically look for this in the html data and scrape it. <td>Current Listeners:</td> <td class="streamdata">3</td> Has this format not changed since Icecast2 was released? Ross. From: icecast-bounces at xiph.org [mailto:icecast-bounces at xiph.org] On Behalf Of josh at thepruitts.org Sent: Friday, 13 May 2011 1:56 PM To: icecast at xiph.org Subject: Re: [Icecast] Standard method to read current listeners without user/password There is a file /status.xsl that contains all the status information for your server. For example, mine: http://radio.foxcub.net:8000/status.xsl You can either parse it with your favorite x?l parsing library or scrape it for listener info. You can see an example of this in action at my page: http://radio.foxcub.net It shows number of listeners and song playing. Josh On 05/12/2011 05:48 PM, Ross Levis wrote: Is there a standard method to read the current number of listeners from an icecast2 server without knowing the admin user/password? We produce radio broadcasting/streaming software for Windows which can show the current number of listeners. Many Icecast hosting companies won't provide the admin password as they have lots of other customers using the same server, so the software doesn't have access to the stats.xml. I'm guessing there isn't any other built-in method, in which case we would have to suggest the customer switches to a Shoutcast server which is disappointing. Regards, Ross. _______________________________________________ Icecast mailing list Icecast at xiph.org http://lists.xiph.org/mailman/listinfo/icecast -- -- "Everyone is a genius but if you judge a fish by its ability to climb a tree it will spend its whole life believing it is stupid." - Albert Einstein -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast/attachments/20110513/6c08ca80/attachment.htm
Geoff Shang
2011-May-13 06:19 UTC
[Icecast] Standard method to read current listeners without user/password
Hi Ross, Sorry if anyone else has already answered this. Yes there is. Icecast can produce stats in any format desired using XSLT templates. These take the built-in XML as input and can format the output any way you like. There are two XSLT templates included with Icecast2 by default, status.xsl and status2.xsl. Status2.xsl would be easy to parse as it outputs in CSV format. The format is: MountPoint,Connections,Stream Name,Current Listeners,Description,Currently Playing,Stream URL Of course, as these are external files, the server admin could call them whatever they want. But in my experience, most people leave them exactly where they are installed. So you'll be able to find it at http://server:port/status2.xsl I've actually been meaning to write to you about this as I'm not real wild about broadcasters having the admin password to the server either. I wish there were some way to password-protect XSL-generated stats with some other password in Icecast2 in order to keep the information safe from prying eyes, but I don't think it is. Maybe a feature for 2.3.3, whenever it comes out? Geoff.
Geoff Shang
2011-May-13 06:24 UTC
[Icecast] Standard method to read current listeners without user/password
Hi, Forgot to add... It'd probably be possible to write an XSLT template which would spit out the same XML data that's already available under the admin password, which would avoid the need to implement new parsing code. But that'd require someone who knows more about XSLT than I do. It'd also need Stationplaylist Studio to support being able to modify the URL for retrieving this data in order to be able to get it, but at least you have control over that *smile*. Geoff.
Ross Levis
2011-May-13 06:28 UTC
[Icecast] Standard method to read current listeners without user/password
Hi Geoff, Status2.xsl looks very promising and easy to read. If status2.xsl will continue to be included as it is now then we'll modify the software to read this. Regards, Ross. -----Original Message----- From: Geoff Shang [mailto:geoff at QuiteLikely.com] Sent: Friday, 13 May 2011 6:19 PM To: Ross Levis Cc: icecast at xiph.org Subject: Re: [Icecast] Standard method to read current listeners without user/password Hi Ross, Sorry if anyone else has already answered this. Yes there is. Icecast can produce stats in any format desired using XSLT templates. These take the built-in XML as input and can format the output any way you like. There are two XSLT templates included with Icecast2 by default, status.xsl and status2.xsl. Status2.xsl would be easy to parse as it outputs in CSV format. The format is: MountPoint,Connections,Stream Name,Current Listeners,Description,Currently Playing,Stream URL Of course, as these are external files, the server admin could call them whatever they want. But in my experience, most people leave them exactly where they are installed. So you'll be able to find it at http://server:port/status2.xsl I've actually been meaning to write to you about this as I'm not real wild about broadcasters having the admin password to the server either. I wish there were some way to password-protect XSL-generated stats with some other password in Icecast2 in order to keep the information safe from prying eyes, but I don't think it is. Maybe a feature for 2.3.3, whenever it comes out? Geoff.
josh at thepruitts.org
2011-May-13 16:12 UTC
[Icecast] Standard method to read current listeners without user/password
Hi all, This is the output of status2.xsl: MountPoint,Connections,Stream Name,Current Listeners,Description,Currently Playing,Stream URL Global,Client:60461 Source: ,,7,, /foxcub,,,7,, - Brian Eno - Dune Prophecy theme, It doesn't look like any csv output I've ever seen. Some of the output seems to be string literal and some of it is the actual server information, and at some parts there's more than one ',' between each entity. Can anyone explain how this format works? Thanks, Josh On 05/12/2011 11:19 PM, Geoff Shang wrote:> Hi Ross, > > Sorry if anyone else has already answered this. > > Yes there is. Icecast can produce stats in any format desired using XSLT > templates. These take the built-in XML as input and can format the output > any way you like. > > There are two XSLT templates included with Icecast2 by default, status.xsl > and status2.xsl. Status2.xsl would be easy to parse as it outputs in CSV > format. The format is: > > MountPoint,Connections,Stream Name,Current Listeners,Description,Currently > Playing,Stream URL > > Of course, as these are external files, the server admin could call them > whatever they want. But in my experience, most people leave them exactly > where they are installed. So you'll be able to find it at > http://server:port/status2.xsl > > I've actually been meaning to write to you about this as I'm not real > wild about broadcasters having the admin password to the server either. I > wish there were some way to password-protect XSL-generated stats with some > other password in Icecast2 in order to keep the information safe from > prying eyes, but I don't think it is. Maybe a feature for 2.3.3, whenever > it comes out? > > Geoff. > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-- -- "Everyone is a genius but if you judge a fish by its ability to climb a tree it will spend its whole life believing it is stupid." - Albert Einstein