Created
August 14, 2017 17:17
-
-
Save simahawk/a93a8368cb80d4e3854d302809f105cd to your computer and use it in GitHub Desktop.
Icecast server JSON status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place this into /usr/share/icecast2/web/json.xsl | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> | |
<xsl:output omit-xml-declaration="yes" method="text" indent="no" media-type="text/javascript" encoding="UTF-8"/> | |
<xsl:strip-space elements="*"/> | |
<xsl:template match="/icestats">{ | |
<xsl:for-each select="source"> | |
"<xsl:value-of select="@mount"/>":{ | |
"server_name":"<xsl:value-of select="server_name"/>", | |
"listeners":"<xsl:value-of select="listeners"/>", | |
"description":"<xsl:value-of select="server_description"/>", | |
"title":"<xsl:if test="artist"><xsl:value-of select="artist"/>-</xsl:if><xsl:value-of select="title"/>", | |
"genre":"<xsl:value-of select="genre"/>", | |
"bitrate":"<xsl:value-of select="bitrate"/>", | |
"url":"<xsl:value-of select="server_url"/>" | |
}<xsl:if test="position() != last()"><xsl:text>,</xsl:text></xsl:if> | |
</xsl:for-each>}</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you.