Would it be hard to have the start time and song length added to the XML? That would eliminate the need for polling at all...
Don't poll the XML file. It would be inefficient and could never work as accurately as the following system that is already in place.
It's not XML, but it's pretty easy to parse out:http://www.wazee.org/bg_transport/currSong.php
Some values you'll be interested in:
song: the song title
nextPacket: number of seconds until new data SHOULD be available. This is occasionally wrong, you should check the msid value to see if you actually received different data, and if not retry again after about 4 seconds.
displayTime: exactly when the song transition is estimated to occur. nextPacket will reach 0 about 24 seconds before the song actually changes on the stream, allowing any clients that are going to connect about 24 seconds to do it and still update on time. This way, the server does not get hammered with 100 requests for currSong.php at exactly the same time. Thus, when displayTime is > 0, you should wait this number of seconds before showing the popup, if you want it to come up exactly when the song transitions. (When displayTime <= 0 the song currently described in currSong.php has already been playing for -displayTime seconds.)
flexibility: recommended variation from nextPacket to make a new connection. If you anticipate many users of your application, please have your applications access this file every nextPacket + (a random decimal between 0 and 1 * flexibility) seconds.
in function handleSongPacket, in case that helps you to see what you should do.