iPhone 7 Day OU Programme CatchUp, via BBC iPlayer

Somewhen last week, I posted about a Recent OU Programmes on the BBC, via iPlayer hack that uses an Open2 twitter feed to identify recently broadcast OU programmes on the BBC, to create a feed of links to watchable versions of those programmes via BBC iPlayer.

So yesterday I had a little play and put an iPhone/iPod Touch web front end onto the pipe.

Here’s the front page (captured using an old version of iPhoney) – I’ve given myself the option of adding more than just the seven day catchup service…

The 7 day Catchup Link takes you through to a listing of the programmes that should, according to the BBC search results (but sometimes don’t always?) link to a watchable version of the programme on iPlayer.

Clicking on the programme link takes you to the programme description – and a link to the programme on mobile iPlayer itself:

Clicking through the programme link take you to the appropriate iPlayer page – where you can (hopefully) watch the programme… :-)

As is the way of these things, I gave myself half an hour to do the app, expecting it to take maybe 90 mins or so. The interface uses the iUI library, which I used previously to build iTwitterous/serendiptwitterous, (various bits of which broke ages ago when Twitter switched off the friends RSS feeds, and which I haven’t tried to work around:-( so all I expected to do was hack around that…

…which was okay, but then the final link out to the iPlayer site didn’t work… Hmmm… now the URLs to the iPlayer mobile programme pages look like http://www.bbc.co.uk/mobile/iplayer/index.html#episode/b00fj0y4′, and the way that the iUI pages work is to display various parts of a single HTML page using anchor/name tags of the form http://ouseful.open.ac.uk/i/ioutv.php#_proglist. So my guess was that the interface library was doing something different to normal whenever it saw a # (which I later refined to the assumption that it was intercepting the onclick event whenever that sort of link was clicked on).

My first thought at a fix was to just add another bit of pipework that would create a TinyURL to the mobile link (and so hide the # from iUI). I found an is.gd pipe and cloned it, but it didn’t work… it looked like is.gd had actually followed the link, got an error page back (“we don’t support that mobile device”) and shortened the iPlayer error page URL. V early hours of the morning now, so I wasn’t tempted to build a TinyURL shortener peipe and went to bed…

Next morning, and in the OU pipes wasn’t working for me very well over the guest network… so I thought I’d set up an Apache RewriteRule that would take a BBC programme ID and generate the mobile iPlayer URL. Nope – the # got encoded and the link didn’t work (I used something like RewriteRule ^ipm/.* http://www.bbc.co.uk/mobile/iplayer/index.html#episode/$1, but couldn’t get # rewritten as #??? Any ideas???)

Next thought – a PHP header redirect – didn’t work… a PHP page that returns some Javascript to reset the page location? Nope… (I later realised I was using the wrong mobile iPlayer URL pattern – I’d transposed mobile and iplayer, but I don’t think that was the only problem ;-)

A short walk to a meeting on ********************* (super secret censored project – I even used an arbitrary number of *’s there; and can’t even tell you who was at the meeting) gave me the crib – use javascript to reset the location in the link (<a href=”javascript:window.location.href=’http://www.bbc.co.uk/mobile/iplayer/index.html#episode/b00fj0y4″&gt;).

Still no…. hmmm, maybe I need to add that to the onclick too? Success!:-)

So there we have it, multiple failure and blind hackery, little or no understanding of what’s not working or why, but always the option to try to find another way of doing it; not pretty, not clever, but not beholden to a particular way of doing it. Come across a problem, and route around it… just do it the internet way;-)

OU Programme 7 day catchup, iPlayer’n’iPhone app. Seen anything interesting lately?;-)

PS see also OpenLearn ebooks, for free, (and readable on iPhone) courtesy of OpenLearn RSS and Feedbooks…

[18/11/08 – the site that the app runs on is down at the moment, as network security update is carried out; sorry about that – maybe I should use a cloud server?]