How To Access Historic Listener Stats

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • mattauckland
    Junior Member
    • Mar 2015
    • 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
  • DrO
    • Sep 2003
    • 27868

    #2
    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...
    WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

    Comment

    • mattauckland
      Junior Member
      • Mar 2015
      • 39

      #3
      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.

      Comment

      • DrO
        • Sep 2003
        • 27868

        #4
        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.

        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.
        WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

        Comment

        • mattauckland
          Junior Member
          • Mar 2015
          • 39

          #5
          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?

          Comment

          • DrO
            • Sep 2003
            • 27868

            #6
            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.
            WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

            Comment

            • mattauckland
              Junior Member
              • Mar 2015
              • 39

              #7
              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.

              Comment

              Working...
              X