Old 4th July 2014, 00:34   #1
knowsports11
Junior Member
 
Join Date: Jul 2014
Posts: 4
Javascript history problem!! (not anymore, now resolved)

I have a question, does anyone have the correct coding for javascript to relay SHOUTcast history onto the page. I have got it where it will display, but it will not update as the music is playing through winamp. Thanks, all help is appreciated.
knowsports11 is offline   Reply With Quote
Old 4th July 2014, 00:44   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
what are you expecting it to update in? so either its due to it being late at night or i'm just not able to make sense of what you're asking about.
DrO is offline   Reply With Quote
Old 4th July 2014, 00:50   #3
knowsports11
Junior Member
 
Join Date: Jul 2014
Posts: 4
I just built a new website. Under the player, I have a shoutcast box that is displaying # listening, bit rate, dj on air, ect. But I cant find the proper code to display song history in the box along with these things. hope that clears it up a little.
knowsports11 is offline   Reply With Quote
Old 4th July 2014, 00:53   #4
aron9forever
Junior Member
 
Join Date: Jan 2014
Posts: 47
Quote:
Originally Posted by knowsports11 View Post
I just built a new website. Under the player, I have a shoutcast box that is displaying # listening, bit rate, dj on air, ect. But I cant find the proper code to display song history in the box along with these things. hope that clears it up a little.
take a look at my website, http://piratefm.ro
it's built almost entirely on iframes. Almost no scripts, just reloading frames

easiest and best solution if you want automatic updating
also for jscript it's probably gonna take an infinite loop and comparing titles to update, but since I use php to get the song I can't make it any other way

don't forget to select a channel from the dropdown menu

please remove the link if it's not allowed, no advertising intended(not even english site)
aron9forever is offline   Reply With Quote
Old 4th July 2014, 01:04   #5
DrO
 
Join Date: Sep 2003
Posts: 27,873
knowsports11: not knowing what DNAS you're trying to work with, i'd have to say make sure you're using the current DNAS (v2.2.1 at time of reply) and look at the 'played' method in the documentation provided with the DNAS.

using that will allow you to get details from the DNAS via javascript easily for the tracked song history (and without having to use evil iframes for things).
DrO is offline   Reply With Quote
Old 4th July 2014, 01:22   #6
aron9forever
Junior Member
 
Join Date: Jan 2014
Posts: 47
Quote:
Originally Posted by DrO View Post
knowsports11: not knowing what DNAS you're trying to work with, i'd have to say make sure you're using the current DNAS (v2.2.1 at time of reply) and look at the 'played' method in the documentation provided with the DNAS.

using that will allow you to get details from the DNAS via javascript easily for the tracked song history (and without having to use evil iframes for things).
why evil
aron9forever is offline   Reply With Quote
Old 4th July 2014, 01:27   #7
DrO
 
Join Date: Sep 2003
Posts: 27,873
because it generally gets used as a work around for things that shouldn't ever need someone to put things inside of an iframe.

http://stackoverflow.com/questions/3...d-bad-practice is interesting reading on the matter. sure there is some valid cases, but i highly doubt it is helpful in this situation if other coding is already in place, then there's no reason why not to keep doing that and query the DNAS directly and format the information in the required manner instead of just dumping the DNAS's history page in an iframe.
DrO is offline   Reply With Quote
Old 4th July 2014, 01:52   #8
knowsports11
Junior Member
 
Join Date: Jul 2014
Posts: 4
DrO: I do have the current DNAS , but the thing with pulling it from DNAS is that im on my own server, not through Winamp. Yet, im still trying to go the javascript way, bc the concept of iframe is loading a new page to server just to run a small portion.

aron9: I checked your page, its only next playing and current playing. I have current playing already, it just seems like you are loading through a playlist.
knowsports11 is offline   Reply With Quote
Old 4th July 2014, 01:58   #9
aron9forever
Junior Member
 
Join Date: Jan 2014
Posts: 47
Quote:
Originally Posted by knowsports11 View Post
DrO: I do have the current DNAS , but the thing with pulling it from DNAS is that im on my own server, not through Winamp. Yet, im still trying to go the javascript way, well simply because it seems like the only way.

aron9: I checked your page, its only next playing and current playing. I have current playing already, it just seems like you are loading through a playlist.
I'm directly parsing the info with php from the plain text page of the shoutcast server that has the current song

if you know how to use php well enough, you can parse the entire history from the songs history page, but that's a little bit harder, mainly because there isn't, at least from what I know, a simple text page with the last songs played

There are a total of 6 iframes on my page that reload every time you change channels, it was the easiest way I could figure out(keeping in mind that i have very basic webdev knowledge) to change all the elements. I can probably cut it down to 4 with the same functionality, the only reason there are so many is because I added the features progressively.

One great advantage of the iframes is that they work on any platform and are very, very flexible. The downside is that they're quite sluggish, but if you don't need to change them often it's not a problem.

I'd also like to add that it's so much easier to handle everything because every element is in a different page, very easy to debug and very well organized.


drobro, if you ever update shoutcast again, please add a plain text site with the song history
aron9forever is offline   Reply With Quote
Old 4th July 2014, 02:07   #10
DrO
 
Join Date: Sep 2003
Posts: 27,873
Quote:
Originally Posted by knowsports11 View Post
DrO: I do have the current DNAS , but the thing with pulling it from DNAS is that im on my own server, not through Winamp.
i'm not following that statement at all or you've really not described things all that well as to what information and from what and where you're trying to get and display things respectively.

as basing things on the first post, the only way to get the true song history is from your DNAS server via the 'played' method (which supports html, xml and json methods).

i'm also not quite getting the Winamp part unless you're trying to have a custom online service page in Winamp or something else like that - as Winamp definitely won't track title updates for streams whilst they're playing (since the history plug-in doesn't work that way).

Quote:
Originally Posted by aron9forever View Post
drobro, if you ever update shoutcast again, please add a plain text site with the song history
with the html, xml and json methods on the /played response, there's no reason to add something non-standard like that. so i'm going to have to say no to that happening as part of the new build i'm helping to contribute towards.
DrO is offline   Reply With Quote
Old 4th July 2014, 02:09   #11
knowsports11
Junior Member
 
Join Date: Jul 2014
Posts: 4
im good, went php with server ip and port im good, thanks for the help. No DNAS needed at all
knowsports11 is offline   Reply With Quote
Old 4th July 2014, 02:10   #12
DrO
 
Join Date: Sep 2003
Posts: 27,873
rightio, as long as you're sure (and i'll change the thread title to indicate there's not a problem now).
DrO is offline   Reply With Quote
Old 4th July 2014, 02:26   #13
aron9forever
Junior Member
 
Join Date: Jan 2014
Posts: 47
Quote:
Originally Posted by DrO View Post
i'm not following that statement at all or you've really not described things all that well as to what information and from what and where you're trying to get and display things respectively.

as basing things on the first post, the only way to get the true song history is from your DNAS server via the 'played' method (which supports html, xml and json methods).

i'm also not quite getting the Winamp part unless you're trying to have a custom online service page in Winamp or something else like that - as Winamp definitely won't track title updates for streams whilst they're playing (since the history plug-in doesn't work that way).

with the html, xml and json methods on the /played response, there's no reason to add something non-standard like that. so i'm going to have to say no to that happening as part of the new build i'm helping to contribute towards.
non-standard?
what about these?
http://live.piratefm.ro:12000/currentsong?sid=1
http://live.piratefm.ro:12000/nextsong?sid=1

Just saying it would be a great addition for users like me and it really is something you can finish in 5 minutes, a copy of this http://live.piratefm.ro:12000/played.html?sid=1 just with the songs

I'm sorry if I'm too insistent or annoying, but I really don't see why you're dismissing it so easily
aron9forever is offline   Reply With Quote
Old 4th July 2014, 10:36   #14
DrO
 
Join Date: Sep 2003
Posts: 27,873
the currentsong and nextsong responses are unfortunate things I had to add and I would prefer not to have them either but its just like the hackish 7.html response as well and we are now stuck with them.

I'm dismissing the request as the correct way to get and process the history information via a clearly defined data standards is provided by the DNAS rather than just having it dump things out as some sort of raw text dump which is then instantly restrictive and I don't want another 7.html like scenario which is what you're asking for. and how do I know if just the title list or title + time or time + title is how it should be ordered - which giving the data as the DNAS does means you or whoever can format it as wanted as whatever default is chosen then there will be complaints.
DrO is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

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