Hi, I realise that the web is littered with posts and discussions concerning the topic of getting icecast stats from the xsl files (status-son.xsl) in the icecast web directory. As you may know, many of the solutions are outdated and example links are broken. I have limited knowledge of how to write my own javascript to get this info to display on my own website. Wondering if anyone can refer me to a currently working example or site that explains how to write my own JS to do this? Alternatively, I am happy to pay someone for their time or script. Damian - - - I prefer to use encrypted email. My public key fingerprint is 77CC 9087 0A92 F55D 75A3 660B 68F2 1FA9 B26E CAC7 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast/attachments/20180513/4fe60231/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: <http://lists.xiph.org/pipermail/icecast/attachments/20180513/4fe60231/attachment.sig>
Apologies, the previous email should have read status-json.xsl Begin forwarded message:> From: Damian <db76 at riseup.net> > Date: 13 May 2018 at 11:59:18 AEST > To: icecast at xiph.org > Subject: Parsing status-son.xsl > > Hi, > > I realise that the web is littered with posts and discussions concerning the topic of getting icecast stats from the xsl files (status-son.xsl) in the icecast web directory. As you may know, many of the solutions are outdated and example links are broken. I have limited knowledge of how to write my own javascript to get this info to display on my own website. Wondering if anyone can refer me to a currently working example or site that explains how to write my own JS to do this? Alternatively, I am happy to pay someone for their time or script. > > Damian > > - - - > I prefer to use encrypted email. > My public key fingerprint is 77CC 9087 0A92 F55D 75A3 660B 68F2 1FA9 B26E CAC7 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast/attachments/20180513/fea0af9c/attachment.html>
hi, it's easy, try that as a start (untested!) it should display the # of listeners for your first source. see that status-json.xsl for all variables defined. <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Demo : icecast stats</title> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script type="text/javascript"> var url = "http://your.server.com:8000/status-json.xsl"; var getstats = function (url) { $.getJSON(url) .fail(function(e) { alert("fail"); }) .done(function(r) { if(r && r.length > 0) { // example: first source var first = r.icestats.source.0; var listeners = first.listeners. $("#stats").html("listeners") console.log(listeners); } }); }; $(document).ready(function(){ setTimeout(getstats, 10000); }); //]]> </script> </head> <body> Listeners: <div id="stats"></div> </body> </html> Damian:> Hi, > > I realise that the web is littered with posts and discussions concerning the topic of getting icecast stats from the xsl files (status-son.xsl) in the icecast web directory. As you may know, many of the solutions are outdated and example links are broken. I have limited knowledge of how to write my own javascript to get this info to display on my own website. Wondering if anyone can refer me to a currently working example or site that explains how to write my own JS to do this? Alternatively, I am happy to pay someone for their time or script. > > Damian > > - - - > I prefer to use encrypted email. > My public key fingerprint is 77CC 9087 0A92 F55D 75A3 660B 68F2 1FA9 B26E CAC7 >> _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast