ITV is the main terrestrial commercial TV network in the UK. They have a TV catch up service called ITV Player which somewhat unusually delivers programmes not using Flash but instead Microsoft Silverlight, there is a port to Linux called Moonlight, but it doesn't work for me. Today though I found out that the Scottish version of ITV; STV has its own TV-on-demand catchup service, and a rather good one too. Programmes are delivered through Flash, so they can be viewed on Linux, but that is not all; I noticed that the site also has RSS feeds, which is quite unusual for a TV-on-demand service. Naturally I wondered if this feed could be adapted for use on Boxee, so I need never miss X-Factor again.
I found two types of RSS feed on the STV player site, there were programme specific ones, these could be dropped straight into Boxee (though the web site) and the programme could then be viewed. There was also a "latest programmes" feed which didn't quite work in Boxee and would link to the page for the programme offering typically the last two episodes. I tried this feed in Boxee, but it didn't pick up a video feed, so it was time to tinker with the feed a little bit with the assistance of Yahoo Pipes. After a bit of experimentation, I noticed too that the developers of the site had even used predictable URLs for the picture files linked to the programme, so it was possible too to add this in to the feed.
The Yahoo Pipe to create this feed can be found at: http://pipes.yahoo.com/liamgh/boxeestvplayer where you can examine it and create your own versions of it. If you haven't heard of Yahoo Pipes before the idea is that it is an environment where you can take web feeds (of various kinds) and create a program that can modify the data and combine it with other data if you wish. All of this can be done visually by connecting together predefined blocks of functionality. It is quite a powerful tool for creating mashups and something I've been spending a bit of time learning recently. The videos provided by the feed are only visible in the UK for various copyright reasons, but you might be able to apply the same ideas to other scenarios.
So on to the pipe itself! It is a fairly simple pipe with humble aims. It does three things:
- Modify the link provided by the "All programmes, All Episodes" RSS feed to point to the RSS feed for a programme, rather than its web page
- Change the 'http' part of the link to 'rss' so Boxee knows this is a link to another RSS feed and will replace the contents of the menu with this RSS feed if selected
- Generate a URL for a preview picture
Once the feed is generated it can be added to Boxee by logging into http://www.boxee.tv, clicking on Feeds, then Add New, adding in the URL of the pipe, ticking Video and clicking Add Feed.
The pipe consists of five steps:
1. Fetch the feed
This just grabs the main RSS feed (http://player.stv.tv/?rss) from the site so we can process it.
2. Copy the 'link' element as 'thumbnail'
We want to provide a nice image that will show as well hover over an item in Boxee. Fortunately the image URLs on the STV Player seem to follow a pattern. This is the start of our new element, we will just create a copy of the link element and in the next step manipulate it. Oddly enough to copy an element we must use the Rename module as this can both rename and copy elements.
3. Change the content of the feed for Boxee
Here we manipulate two elements of the feed with regular expressions. The first regular expression looks for the pattern http://(.*) which means 'grab everything in the URL after the http:// part' and then replaces the content of the link element with the pattern rss://$1?rss which means create a string that starts with 'rss://' (see http://developer.boxee.tv for more information on Boxee RSS feeds), add in the stuff we grabbed (this will replace the '$1' in our expression), then add '?rss' to the end which gets STV Player to generate RSS feeds rather than web pages.
The second regular expression modifies the new element we created in the last step. It looks for a pattern of http://player.stv.tv/programmes/(.*)/ so it will grab a part of the URL which is unique to the programme, e.g. for a URL of 'http://player.stv.tv/programmes/the-x-factor/' it will grab 'the-x-factor', we then drop this into two locations in a new pattern that should give us an image URL: http://files.stv.tv/img/player/$1/$1.jpg so in our example we should get 'http://files.stv.tv/img/player/the-x-factor/the-x-factor.jpg'.
4. Map the information onto an RSS feed
The information we obtained is of course an RSS feed, but we do this step as an easy way to drop our new image thumbnail URL into the correct element for Boxee to be able to display it.
Every Yahoo Pipe ends in a 'Pipe Output' module and ours is no different.
So now we have an RSS feed that Boxee will handle!
Boxee will use its own internal RSS renderer to give you a menu you can naviagate with a remote control, if you click on an item you will see the available episodes, then clicking on an episode will bring up the player.
It isn't a perfect feed, the control panel of the original embedded flash player is still shown. The other thing to note is that on the site the different parts of the show are shown as seperate links. Boxee will play these parts one after the other but you will notice the time remaining being shown in this control panel is for the part of the programme that you are on.
This small experiment again shows just how useful RSS feeds are. By providing quite simple RSS feeds STV have now gained functionality for programmes to be shown in Boxee at no extra cost to them. It isn't perfect, but usable. For broadcasters this is good news as they embed adverts in the videos themselves and if you use Boxee you still get to see these. It also shows how useful Yahoo Pipes can be to modify a feed that is "almost there". If you like the idea of using Yahoo Pipes to generate RSS feeds for Boxee you might also like this: Deli TV – Personally Programmed Social Television Channels on Boxee: Prototype from Tony Hirst.