0xDECAFBAD

It's all spinning wheels and self-doubt until the first pot of coffee.

A mini-scraper for the playlist at radioio Rock

Lately, my iTunes has been playing radioio Rock almost exclusively lately, but one thing that peeves me is that I don't seem to see the current song while the stream's playing. Instead, the radioio site offers a pop-up window that displays the last few songs in the playlist. However, I'm usually somewhere off in another window or a shell and don't really feel like popping over to a browser and navigating to the playlist just to see what this song is.

So, I wrote myself a little mini-scraper script:

#!/bin/sh

curl -s 'http://player.radioio.com/player.php?b=614&stream=radioioRock' | \
    tidy -asxml --wrap 300 -q -f /dev/null | \
    xml sel -t -m "//*[@class='leadrock']" -v '.' -n \
        -o '    [http://www.radioio.com' -v '../@href' -o ']' -n 

The output looks something like this:

[06/29 11:01:08] deusx@Caffeina2:~ % radioio

Vast - I Need To Say Goodbye
    [http://www.radioio.com...]
Cure - The End Of The World
    [http://www.radioio.com...]
Seachange - Avs Co 10
    [http://www.radioio.com...]
Pixies - Bam Thwok
    [http://www.radioio.com...]
Death Cab For Cutie - The New Year
    [http://www.radioio.com...]
Lovethugs - Drawing The Curtains
    [http://www.radioio.com...]

Oh yeah, and to run this script, you will need these tools:

Personally, I like the included URLs (which I edited here for length) since they launch a search for CDs by the artist. However, you can cut the output down to just the artist/title by removing the final line of the script and the backslash at the end of the line before.

If you like a different radioio station, say radioio Eclectic, you can change stream=radioioRock to stream=radioioEclectic in the URL above and change class='leadrock' to class='leadeclectic'. I could have parameterized these, but I'm lazy, and that was the whole point!

ShareAndEnjoy!

shortname=radioiorock_scraper

Archived Comments

  • I was listening to some streams today for the first time in a while and I was thinking how annoying it was not to know the track names. Thanks for posting this, it may come in handy!
  • How is this the first time I've ever found out about XML Starlet? It's magnificent! The application is cool, too, but /man/ - I'm going to have fun with XML Starlet. Thanks so very much for the pointer, Les!
  • I was searching around with blowsearch.com today (which btw blows heheh) and found this entry. This earl might be of interest to ya: http://69.28.133.51:1040/7.html The db for searchplay and our players is only updated every 30 seconds, 7.html is near reatime right from our playback software. :) We used to have title streaming on our mp3 streams but are in transition of server and encoding software atm while we prepare to roll out our own software, and will be adding new formats such as heaac. :) Too much to talk about, we have a LOT of stuff planned for 2005-2006 that we've been working on (and patent pending) for years now. Definately going to be exciting time for net radio. Thanks for your interest Leslie. jesse chief tinkerer of toys, radioio