[Icecast] Parsing status-son.xsl

unosonic un at aporee.org
Tue May 15 11:35:09 UTC 2018


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



More information about the Icecast mailing list