Old 17th April 2015, 23:20   #1
mattauckland
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
mattauckland is offline   Reply With Quote
Old 17th April 2015, 23:45   #2
DrO
 
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...
DrO is offline   Reply With Quote
Old 17th April 2015, 23:51   #3
mattauckland
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.
mattauckland is offline   Reply With Quote
Old 18th April 2015, 00:07   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
Quote:
Originally Posted by mattauckland View Post
So can I get the info from the DNAS live, and log that myself at my end?
yes as that is what a lot of the reporting companies / tools do for tracking things.

Quote:
Originally Posted by mattauckland View Post
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.
I suggest you look at the docs and the ones which detail the xml / json responses as they disprove most of the comments you've just made and show what information you can actually get. as there is enough information provided to allow you to determine new listeners, existing listeners and finished listeners (specifically with the 'uid' value).

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.
DrO is offline   Reply With Quote
Old 18th April 2015, 00:29   #5
mattauckland
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?
mattauckland is offline   Reply With Quote
Old 18th April 2015, 00:56   #6
DrO
 
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.
DrO is offline   Reply With Quote
Old 18th April 2015, 02:21   #7
mattauckland
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.
mattauckland is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Tags
php, stats, xml

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump