-
-
Save denzuko/2d007ba69afe3647899bd29f9d6b3598 to your computer and use it in GitHub Desktop.
Icecast server JSON status
This file contains hidden or 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