Monthly Archive for February, 2006

New Radio Paradise Banner

I’ve re-written the RP banner since the old one broke (and quite badly I might add). BillG was kind enough to provide us with a raw XML feed which we can use with our little projects, so I re-made it to use that.

I’ve made it Open source, so anyone can modify it and mess with it how they like. But if you could shoot me an email (it’s in the script) if you do something with it: improvements are always welcome.

It’s not perfect – there are some areas that really need some R&D, like the transitions between songs (the XML feed doesn’t seem to update quite when it says it will – whether that’s down to server time differences I don’t know). I’ve added some bits and pieces to take that into account which you can tweak as appropriate. I’ve also added some load balancing (of sorts) with a random number generator so that all the clients don’t refresh at exactly the same time.

The caching system really needs to be improved too. I’ve been trying to sort out locking files so that they can be given a slightly longer “lifetime” if the song overruns, but that’s really a hack. The reality of it is that if the song overruns there isn’t much else to do than keep downloading the file until it does change. The extension thing was just there to limit the downloading a little.

The best you can do to keep the caching system working is to have exactly the same time (down to the second!) of the RP servers – the best way I’ve found to do that is to use NTP to keep your server clock accurate.

Enough of this yinner yanner. You want to see my horrible messy code, right?
Radio Paradise Now Playing Banner PHP Code

Have fun with it!

EDIT! There was a MAJOR CSS error with the banner. The cool stuff wouldn’t show up. How lame! I’ve updated the zip now so if you’ve got that problem just download it again and it’ll be fixed.