-
Website
http://www.th1nk.com -
Original page
http://www.th1nk.com/code/how-to-pull-statistics-from-icecast-with-php/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
e-recruitment
1 comment · 1 points
-
Acana Dog Food
2 comments · 1 points
-
-
Popular Threads
I actually haven't tested this with multiple mount points - I just threw it together for a station I run in my personal time, so let me play with it a bit and see what I can come up with.
As to the IP address listings, if you do a print_r($stats) on the array returned back from the get_parsed_stats() function, you'll see what fields you have available for output - listener count and such are available, but I don't see a way off-hand to get the IP addresses of listeners. It would probably entail parsing another one of the XML files on the server, but like I said, this was just a quick thing I threw together, so I'm not sure.
I'll take a look and see what I can come up with for both issues, here, and post back.
- John
it works fine, but we have 5 mountpoints in the stats
/48
/96
/128
/dump
/live
the listeners in the script comes from /live
how can i change to /128 ?
and can i list ips from
http://......../admin/listclients.xsl?mount=/128
mfg
huelgueuer
it works very fine. now can i read all parameter in every mount point. thanks.
holger
I am totally new to PHP and found that it wouldn't run at first on my hosting company's server (which is running PHP 5). I found that I needed to change the line
require_once('icestats.php');
in the example page to
include 'icestats.php';
Otherwise I got a 'class declared twice' error or something like that.
Also for those people like me who don't have a clue how to extract individual fields from the returned object, after a bit of trial and error (!) it turns out you can do it like this:
For example, to print the current artist:
echo $stats->artist[0];
Basically change 'artist' above for whatever other field your are interested in..
Thanks again for sharing your code -
Matt
I can not to manage it to work. See the error... How can I fix it?
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/mslino/atcbsb.com.br/icestats.php on line 16 Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /local/home/mslino/atcbsb.com.br/icestats.php on line 16 Warning: fsockopen(): unable to connect to atcbsb.com:8000 (Connection timed out) in /local/home/mslino/atcbsb.com.br/icestats.php on line 16 Warning: fputs(): supplied argument is not a valid stream resource in /local/home/mslino/atcbsb.com.br/icestats.php on line 25 Warning: fgets(): supplied argument is not a valid stream resource in /local/home/mslino/atcbsb.com.br/icestats.php on line 26 Warning: fclose(): supplied argument is not a valid stream resource in /local/home/mslino/atcbsb.com.br/icestats.php on line 27 The requested station is currently unavailable.
Thanks!
Thanks
icestats.php seems to produce an error - I believe - whenever the current song has scandinavian characters in its name (like å,ä,ö). I found out that the reason is SimpleXML can only output utf-8... possibly. I was just wondering if there was some way stop this error from happening.
Thanks again