RSS and Atom feeds for RadioParadise.com ++

| | Comments (2)

Update (2006-01-16): I completely revised the code that generates the RSS 2.0 feed. It is much more stable, since it uses a Radio Paradise-generated XML feed as its source, and creates the feed using the DOM. Please use the new feed. Here is the source code.

...

My friend Mike recently introduced me to Radio Paradise, an internet radio station that plays commercial-free indie-rock, with some classic stuff thrown in. I became addicted to it almost immediately, in part because it's great music to have on in the background when you're working on other things, and you're guaranteed to be exposed to all kinds of stuff you've never heard before.

Radio Paradise has a page that lists its most recently played songs, going back about 6 hours. I thought an RSS feed of this page might be useful/enjoyable for some people, including me, but Radio Paradise doesn't offer such a feed yet. So, I spent a few hours last night writing a PHP script that "scrapes" the "recently played" page, and translates it into an RSS feed. Update: I also wrote a script that creates a feed for RP's recently active forums list.

Update (10/27/04): I have released the source code for this project. This allows you to generate the playlist feed from your own website. The only requirements are that your server can run PHP with the CURL functions. All you have to do is copy this file to your server, remove the final "s" from "feed.phps" and access it in your browser or RSS reader. Note there are some slight constraints on your redistribution and use of the code. Please see the comments in the file.

Progammers will notice that a single script determines whether to return an RSS feed or an Atom feed, as determined by a parameter the user passes on the URL. I think this is somewhat uncommon.

The feed will generate automatically every time you access it. In other words, it will be in perfect synchronization with Radio Paradise's page as long as you refresh it.

Now that the information is in this standard format, I'm sure someone could write another script to do something interesting with it, or you can just add it to your RSS/Atom news aggregator, and see what the station has been playing, without having to visit its website.

The script is more stable than it was at first, but I would still expect bugs from time to time, including critical ones. Email me any bug reports, and I'll see what I can do.

If you use this feed, please leave a comment, so I can report your interest to the Radio Paradise staff, who are aware of this project.

Categories

,

2 Comments

Goldfish said:

I did somthing interesting with it. I made a banner for RP which displays what is currently playing. I'm also using lastrss.php to parse the RSS feed at my end.

It would be possible to work out the length of the song that is being played currently, by scraping the self-updating banner on their website... the meta-refresh is set to make the pane refresh when the next song starts :) Unfortunately, this data isn't on the playlist page, and isn't logged with the other data.

I'll be downloading your script and running it on my own webspace (for the sake of completeness) at some point, and probably remove the need for the RSS feed by going directly from your script to the output.

Thanks for the script! :-)

ADM said:

Thanks for the comment, Goldfish.

Please note that I built this script before I really understood how to properly build XML/RSS documents using PHP. Several months later, I learned to use the DOM. This post explains how to do it.

http://thousandrobots.com/blog/archives/2005/02/use_php5s_dom_s.php

Leave a comment

About this Entry

This page contains a single entry by ADM published on October 14, 2004 2:49 PM.

Jeopardy category: Blogs + [now with audio] was the previous entry in this blog.

Morse code embedded in Nike's Red Sox ad is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.0