Old 1st February 2012, 23:56   #1
Junior Member
Join Date: Feb 2012
Posts: 2
Query for currently playing track by station id?

What is the best method for querying the currently playing track by station id? Is there public access to this information from a server?

It appears the SHOUTcast API doesn't expose such a query--you can search for songs or genres and reveal the stations that are playing that song, but you cannot do the reverse from what I read.

I understand that not every station actually shares this information or they hijack that feed for advertising, but many do list it. I've contemplated parsing the /7.html from a server address but appears that support for that page is deprecated. I need a JavaScript solution.

Thanks for any info.
simpleshadow is offline   Reply With Quote
Old 2nd February 2012, 09:17   #2
Join Date: Sep 2003
Posts: 27,873
it can be obtained from the DNAS server though would depend on the DNAS verson (the v2 DNAS docs indicate how for that version) though scraping such information from the DNAS is likely to be not met nicely by a lot of station owners i.e. am wondering the reason why you're trying to get the information.

DrO is offline   Reply With Quote
Old 2nd February 2012, 21:25   #3
Junior Member
Join Date: Feb 2012
Posts: 2
Thanks for responding so quickly!

For an application I have, I would like to display to the user which track is currently playing or whatever information is in that feed.

Any good public strategies?
simpleshadow is offline   Reply With Quote
Old 6th February 2012, 16:14   #4
dotme's Avatar
Join Date: Feb 2005
Location: USA
Posts: 4,024
I'm going to add my vote to the return of 7.html or some simple way to grab now playing and listener count stats from a DNAS without downloading the full XML. On a station with 1000 listeners, that's one heck of a download every 60 seconds, not to mention the authentication overhead.

Why? I have to log over 850 servers across dozens of hosts/data centers every minute of every day for royalty reports.

When you're pulling listener counts, bitrate and now playing from that many instances as frequently as once every 60 seconds, having a skinny (7.html-type) no-auth file really helps.

dotme is offline   Reply With Quote
Old 6th February 2012, 16:36   #5
Join Date: Sep 2003
Posts: 27,873
the now and next playing can be pulled directly as per the first two methods at http://wiki.winamp.com/wiki/SHOUTcas...2#Public_Pages

i understand that an xml response will be using more bandwidth and processing than 7.html did but that's what has been decided upon and i really don't think it's that much overall since all that's currently output is what is shown at http://wiki.winamp.com/wiki/SHOUTcas...Server_Summary which will only output what is actually present at the time so only what is needed will come back. though there is going to be one addition in the next release for knowing the user/dj name currently connected instead of using the irc/aim/icq hacks which using a fixed format would make harder to add a new field.

maybe 7.html or something like it should be brought back but then i'm not the one who needs to be convinced of going back / making an alternative (since these are things which were decided on well over 2 years back) and this change has been driven by partner requests and also our own internal usage so i'm just going to follow orders on such things.

there probably are some aspects which could be removed from the output to slim it down further for querying just specific aspects instead of what is done i.e.
listener counts (current, peak, max, average)
stream details (name, genre, type, path, bitrate)
dj details (djname, irc, aim, icq)

i'm open to ideas to make suggestions to see if it would be considered (though obviously is no guarantee it'd ever be considered, etc).

DrO is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

javascript, now playing, public, query

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