Things to do with /programmes #431: iTunes!
If you've been reading RadioLabs for a while you'll know that we go on about how we've tried to design bbc.co.uk/programmes for machines as well as for people.
What we mean is that we've tried to make it easy for machines to get at the programme information behind the site, so that it can be re-presented in useful and novel ways.
Here's an example from a hack I've been working on:

You're looking at a screenshot of iTunes running on my laptop. I've poked information from /programmes in there so that genres show up as playlists, and episodes show up as songs. It's as if BBC Radio were an iTunes shared library located somewhere on my local network. You can also see the hack in motion.
Here's what I was thinking: all my music is in iTunes. iTunes, via an Airport Express, plays out through my Big Speakers. Wouldn't it be nice to be able to use it to find out what this week's Thinking Allowed is about, or to enjoy some rough dubplate pressure from 1Xtra?
So how does it work?
Simply, the app grabs programme information from /programmes and re-presents it to iTunes in its native tongue: DAAP.
We've tried to design /programmes to make this kind of thing easy.
For example: the app needs the following information:
- which genres have radio programmes in them?
- for a specific genre, which programmes are currently available on-demand?
/programmes answers the first question at http://www.bbc.co.uk/radio/programmes/genres/, and the second at http://www.bbc.co.uk/radio/programmes/genres/drama/relationshipsandromance/player and its cousins.
Only interested in Radio 4? Hack that url to http://www.bbc.co.uk/radio4/programmes/genres/drama/relationshipsandromance/player. Or TV? Try http://www.bbc.co.uk/tv/programmes/genres/drama/relationshipsandromance/player.
Just add XPath!
If you'd like to try this for yourself I've made the code available for your delectation. It's My First Erlang, be gentle :-)
And if I've inspired you to try and build your own hack on top of /programmes, here's the way in - let us know how you get on!
~RS~q~RS~~RS~z~RS~12~RS~)
CommentsSign in
You need to sign in to contribute to this page. If you're new to BBC Blogs, creating your membership is quick and easy.
Matthew, - installed, and working on Itunes 8. This is great, I for one will be using this rather often. well done.
Complain about this comment
The obvious question is, can we actually listen to the programmes?
Either way, well done!
Complain about this comment
@Ed Lyons - sorry that's not clear. Yes, you can listen to the streams - check out the 'see it in motion' link...
Complain about this comment
Seems a shame that you have to parse the HTML code to get the data ... how about making a "genuine" XML version of the genre information ... or put the genre information into the programme details XML ?
Complain about this comment
Interesting - how did you get the flash streams to work in iTunes?
Complain about this comment
@PaulWebster you're right, my karma level is so low :-( xml versions are in the pipe, we know we need them. i just wanted to demonstrate that stuff could still be built...
@FrankieRoberts so: when you click on a show in itunes i'm making an rtmp connection back to the BBC, then streaming that audio back to itunes. this was a pretty interesting challenge, but it (mostly) works.
any more reports that this does or doesn't work in itunes 8...?
Complain about this comment
Just tried it - works with iTunes 8 on Mac OS X 10.5.4, had to fiddle with the priv/bbc2daap_0.1.0.rel file.
Complain about this comment
Also, I noticed that there's nothing from Radio 1 - is this normal?
Complain about this comment
@DiggoryDotNet thanks for giving it a whirl - the lack of Radio 1 shows is because we have some xhtml validation issues at present - hoping this'll be sorted soon...
Complain about this comment
This looks brilliant. I'd love to use it with iTunes on my MacBook, but being non-technical - I haven't a clue what to do to install it or get it working!
Could someone post an idiot's guide please?!?
Complain about this comment
This sounds exciting. Excuse my technical naivety, but could this be used to get a step closer to radio on the iPhone? iTunes on the phone is very different though, huh.
Can't wait for radio 4 on my phone. It really is the one missing piece. Is it going to happen?
Complain about this comment
Matthew - great hack - working well, though it does take a bit of time to start up and fetch all the stream data.
Given that this is the bbc supporting extracting the mp3 stream from flash and piping to another player, could we lobby for a native mp3 stream to be made available for all of these programmes?? This would make it far simpler to get the streams into a variety of media players and devices including itunes.
Complain about this comment
The download appears to have vanished from Google code.
Complain about this comment
yllierneb, you'll find the source code here : http://radio2daap.googlecode.com/svn/trunk/
Thanks again Matt for giving me a pointer to get this working on Windows XP
Complain about this comment
Will this work back to the Apple TV ie if I have this DAAP service running somewhere will the Apple TV see it. Thanks
Complain about this comment
Matt, could you explain how to get this to work on win xp?
Complain about this comment
View these comments in RSS