![]() |
#1 |
Junior Member
Join Date: Mar 2015
Posts: 39
|
How To Access Historic Listener Stats
Hi,
Is there a way to pull 30 day or Daily stats from Shoutcast server, via PHP or XML? I've been a developer for a long old time, and I'm wondering if the Shoutcast server provides a way pull the data, be that via JSON or XML. I know the XML interface gives you the current/real-time stats, but I need the historic information to report to the licensing authorities. Information like total listeners during a period, and listener time. I've read something about WC3 logs (not sure what they report), but I don't know how I can access that via PHP. I'm running the latest server distro. If that is not possible, is there a way to code in a hook to Google Analytics? If not, can I suggest that as a future feature. Would be awesome for Google Analytics real-time stats ![]() |
![]() |
![]() |
![]() |
#2 |
Join Date: Sep 2003
Posts: 27,873
|
you'd have to parse the files (w3c or main log) yourself to get prior listener stats or ensure you're logging the info from the DNAS live. but overall, the DNAS as-is requires you to do the work to track such matters as everyone wants to do it their own way and so the DNAS just provides the means to get the live stats (or re-parse from logs) so it's pretty open.
as for your request, that exact scenario won't be happening... |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Mar 2015
Posts: 39
|
Oh, ok, thanks DrO.
So can I get the info from the DNAS live, and log that myself at my end? If so, how could I determine when a listener tunes in, and then out? As I understand it DNAS only says you have 4 people (for example) listening. But nothing detailed like IP's and such. So to determining when one of those 4 people is a new person is not possible. |
![]() |
![]() |
![]() |
#4 | ||
Join Date: Sep 2003
Posts: 27,873
|
Quote:
Quote:
it's just how often you query the DNAS as to how quickly you would then pick up new / stopped listeners. especially as the more listeners you have, the greater the potential impact it will have on the DNAS responsiveness. |
||
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Mar 2015
Posts: 39
|
Coolio. I take it that's all in the wiki?
I assume ruining say a query every 30 seconds isn't going to txt the DNAS too much? |
![]() |
![]() |
![]() |
#6 |
Join Date: Sep 2003
Posts: 27,873
|
it's in the docs provided with the DNAS installer / archive (the wiki is still waiting to be updated).
30 seconds won't tax it but you'll probably also miss some of the shorter lived connections. a few seconds (5 or something like that) is probably more applicable, but it depends really on you usage levels (and the setup the DNAS is running on) as to how often you can query without seeing any impact. as higher spec setups can happily run on a 1sec interval without effect - that's only something you can really work out from testing for your needs. |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Mar 2015
Posts: 39
|
Thats great, thanks DrO. I'm going to mock something up, and try and build it out later as a service people can use.
I have 2 DNAS units running MP3 on one, and AAC on the other. Each server is a Digital Ocean box with 1GB Mem, 1 Core Processor, 30GB SSD, and 2TB Transfer. All they run is CentOS 6.5 64bit and DNAS, that's it. Very low footprint install, with extra swap file if needed. If/when things pick up I'll shift them to dedicated, or just add more instances to spread the load. It's cheap enough at Digital Ocean, and quick to deploy now I've created an image. |
![]() |
![]() |
![]() |
|
Tags |
php, stats, xml |
Thread Tools | Search this Thread |
Display Modes | |
|
|