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 ´óÏó´«Ã½ Radio were an iTunes shared library located somewhere on my local network. You can also see the hack in .
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: .
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 /radio/programmes/genres/, and the second at /radio/programmes/genres/drama/relationshipsandromance/player and its cousins.
Only interested in Radio 4? Hack that url to /radio4/programmes/genres/drama/relationshipsandromance/player. Or TV? Try /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 . 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!
Comment number 1.
At 10th Sep 2008, bigdaddymerk wrote: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 (Comment number 1)
Comment number 2.
At 10th Sep 2008, Ed Lyons wrote:The obvious question is, can we actually listen to the programmes?
Either way, well done!
Complain about this comment (Comment number 2)
Comment number 3.
At 10th Sep 2008, __hellomatty wrote:@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 (Comment number 3)
Comment number 4.
At 10th Sep 2008, Paul Webster wrote: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 (Comment number 4)
Comment number 5.
At 10th Sep 2008, Frankie Roberto wrote:Interesting - how did you get the flash streams to work in iTunes?
Complain about this comment (Comment number 5)
Comment number 6.
At 10th Sep 2008, __hellomatty wrote:@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 ´óÏó´«Ã½, 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 (Comment number 6)
Comment number 7.
At 10th Sep 2008, DiggoryDotNet wrote: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 (Comment number 7)
Comment number 8.
At 10th Sep 2008, DiggoryDotNet wrote:Also, I noticed that there's nothing from Radio 1 - is this normal?
Complain about this comment (Comment number 8)
Comment number 9.
At 10th Sep 2008, __hellomatty wrote:@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 (Comment number 9)
Comment number 10.
At 12th Sep 2008, speedyrite wrote: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 (Comment number 10)
Comment number 11.
At 15th Sep 2008, FleonSunoco wrote: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 (Comment number 11)
Comment number 12.
At 20th Sep 2008, triode1 wrote: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 (Comment number 12)
Comment number 13.
At 20th Sep 2008, yllierneb wrote:The download appears to have vanished from Google code.
Complain about this comment (Comment number 13)
Comment number 14.
At 21st Sep 2008, AVeryCh33kyMonkey wrote:yllierneb, you'll find the source code here :
Thanks again Matt for giving me a pointer to get this working on Windows XP
Complain about this comment (Comment number 14)
Comment number 15.
At 23rd Sep 2008, EdCoops wrote: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 (Comment number 15)
Comment number 16.
At 10th May 2009, cknigge wrote:Matt, could you explain how to get this to work on win xp?
Complain about this comment (Comment number 16)