[Icecast] IceCast Listenter Count Stat - BASH or php?
unosonic
un at aporee.org
Wed Mar 14 15:19:49 UTC 2018
just parse status-json.xsl with php's curl/json_parse...
ScanCaster:
> On Mon, 12 Mar 2018 22:07:34 +0100, Jeroen van Oosten wrote:
>
> > Well, you can create your own XSL with less data. I use this (as
> > web/simple.xsl):
>
> Well since I don't know XSL, BASH etc. was my go to choice...
>
> BUT...
>
> Doing this gets
> 404's from a browser or wget
>
>
> I put this in the folder as per below, did a kill -HUP and still get
> 404's
>
> root at audio:/etc/icecast2/web# ls -la
> total 36
> drwxrwxr-x 2 icecast2 icecast 4096 Mar 14 10:38 .
> drwxrwxr-x 4 icecast2 icecast 4096 Jul 22 2017 ..
> -rw-rw-r-- 1 icecast2 icecast 2009 Dec 14 2014 auth.xsl
> -rw-r--r-- 1 root root 0 Mar 14 10:39 count.txt
> -rw-r--r-- 1 icecast2 icecast 500 Mar 14 10:34 count.xsl
> -rw-rw-r-- 1 icecast2 icecast 2182 Dec 14 2014 server_version.xsl
> -rw-rw-r-- 1 icecast2 icecast 1882 Dec 14 2014 status-json.xsl
> -rw-rw-r-- 1 icecast2 icecast 5321 Dec 14 2014 status.xsl
> -rw-rw-r-- 1 icecast2 icecast 3879 Dec 14 2014 style.css
> root at audio:/etc/icecast2/web# cat count.xsl
> <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version
> = "1.0" >
> <xsl:output omit-xml-declaration="no" method="text" doctype-public="-//
> W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/
> xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
> <xsl:template match = "/icestats" >
> <xsl:for-each select="source">
> <xsl:value-of select="@mount" /><xsl:value-of select="listeners" />
> <xsl:text>
</xsl:text>
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
>
> root at audio:/etc/icecast2/web# wget -O count.txt http://
> audio.xxxxxxx.tld:8000/count.xsl
> --2018-03-14 10:39:31-- http://audio.xxx.tld:8000/count.xsl
> Resolving audio.xxx.tld (audio.xxx.tld)... 23.250.7.36
> Connecting to audio.xxxx.tld (audio.xxx.tld)|23.250.7.36|:8000...
> connected.
> HTTP request sent, awaiting response... 404 File Not Found
> 2018-03-14 10:39:31 ERROR 404: File Not Found.
>
> IF I rename it to status.xsl then it works...
>
> How do to get it to rescan the web dir??? killing and restarting is not
> an option. Dumping several hundred listeners is not good form.
>
> Also can this be customized to JUST ONE MOUNT???
>
> IE: For EACH MOUNT I would have one of these counMOunt1.xsl and then I
> process each in turn for their count
>
> THANKS!
>
>
> _______________________________________________
> Icecast mailing list
> Icecast at xiph.org
> http://lists.xiph.org/mailman/listinfo/icecast
More information about the Icecast
mailing list