skip main content

Posts Tagged ‘BBC’

I built a Chrome extension, and yes it shows BBC Now Next information

posted by Duncan at 12:33 pm on February 8th, 2010

UPDATE: I added a new feature. Reminders

I like Google Chrome, it’s fast and simple and works as expected. It’s currently my main browser, and with Extensions, it’s likely to remain that way.

An extension is a zipped bundle of files — HTML, CSS, JavaScript, images, and anything else you need — that adds functionality to the Google Chrome browser. Extensions are essentially web pages, and they can use all the APIs that the browser provides to web pages, from XMLHttpRequest to JSON to HTML5 local storage

I use a Mac so extensions have not been available to me, until that is the dev versions of Chrome started incorporating them. I installed it the other day, and thought I’d have a play at creating one. You can build them too, as their dev site is very helpful.

Using my standard use case, I have built an extension that displays BBC stations Now and Next information. Give it a whirl:

You can see what it looks like in action below.

chrome extension

It uses feeds from BBC Programmes, the upcoming feed and the lesser know service feed. So you install it, and choose the stations you are interested in. You then get to see what is on now and next when you click the BBC icon that appears in the browser bar. the results are clickable. You can click on the network icons to listen or watch live. You can click on the show images or heading to go to that shows programme page.

Oh, and if you’re interested in the code, it on available via my Github account.

Enjoy!

Creating shopping lists from BBC Recipes using Sinatra

posted by Duncan at 12:44 pm on October 28th, 2009

[UPDATED] The BBC Recipe site has now been update. See updated blog post.

This is another case of looking at a BBC site I use frequently, and extending it. Here’s my use case. I found a recipe I’d like to make from the BBC Recipes site, so I first need to buy the ingredients. The ingredients by default are part of the recipe page, and even if I print out the recipe, it’s still got stuff I don’t need. It would be nice if I could just turn that recipe information into this:

Ingredients

It’s a simple list of ingredients, that have a checkbox next to each item to mark when I have put it in my basket.

So I have built myself a simple Sinatra app that does just this:

If you look at it on your iphone it will look styled, whereas on other devices it will just look simple and standard.

From the site you just need to post the url of a recipe you want the ingredients listed, for example the screenshot above is what happened when I posted this url into it:

It’s very simple, give it a try, see what you think.

Ok, one thing I should note, is that I can’t be sure it will be 100% correct every time. This is a real pain, but out of may hands. The BBC recipe pages look very nice and all, but the most important part of the page “The Recipe” is not only terribly marked up, but it’s not consistent. I suspect this is due to being a free text field in a legacy CMS? but it means that when I get my application to try to look at it, and turn it into a list of ingredients, I can’t be sure of the structure and have to make a bunch of assumptions, which are sometimes wrong.

It would be great if this could be rectified, as we could then see lots of experiments like this out there. In fact with well marked up recipes, and there does appear to be a recipe markup spec:

People could build some great application around all this information.

BBC Gardeners’ Planner in your calendar part deux

posted by Duncan at 1:01 pm on October 20th, 2009

This is just a small extension to the original post: Subscribe to the BBC Gardeners’ Planner with the help of Sinatra.

I mentioned there that I needed to add some caching to the application, and also that it didn’t live anywhere. Well it now has caching (a feeds cached for a day) thanks to rack/cache and it now has a url:

Which you can now use in your iCal enabled calendar, one of which is Google Calendar, which is used in the photo below where I have subscriber to:

Google Calendar

I was having some strange problems the other day, where Google Calendar was showing the calendar titles as long email addresses. I think this may be a Google Calendar index thing (anyone know?), as it appears to fix itself over time so ignore it.

Subscribe to the BBC Gardeners’ Planner with the help of Sinatra

posted by Duncan at 9:45 am on October 15th, 2009

[UPDATE] I have posted an update with a url you can use

I really like being in my garden, so I was looking at the BBC Gardening site the other day for some gardening tips. The hardest part for me, is the lack of experience I have in knowing what needs to be done and when.

The BBC Gardening website solves this by having a gardeners’ planner. Great I thought, there’s loads of really useful stuff in there. The problem is I have to keep going back to the site, to check what I’m suppose to be doing. As it’s a planner, it would be great of I could have this information to put in my own calendar, so I could see it along with other jobs I have to do. Even better if I could subscribe to this information, so if it ever changes, I’m kept up-to-date. Maybe they will provide this one day (I really think they should), but in the mean time I decided to roll my own:

Subscribing to the BBC Garden planner

I’ve created a web app that reads this planner data, and converts it into the iCal format that you can now subscribe to. It’s written using Sinatra, and I choose to run it under the awesome Passenger via mod_passenger. It’s currently not hosted anywhere (other than on my laptop), so you’ll have to run it on your own server. Maybe that will change if I can find somewhere to stick it, I’ll keep you posted. I think some caching may be needed before that happens though.

Once running on your computer of choice, you only really have one uri to stick in your calendar of choice. You can extend this uri by passing in section names to filter the information displayed in the calendar. Here’s a few examples:

# to subscribe to a calendar of everything ( quite big! )
http://mydomain.local/planner.ics
 
# to subscribe to a calendar of tips on just trees, ponds and wildlife
http://mydomain.local/planner.ics?s=trees,ponds,wildlife
 
# to view all the available sections
http://mydomain.local/

And here’s what it looks like in Apple’s iCal once you have subscibed:

BBC Garden planner in iCal

Get your own copy of the app from github. You get up and running in the same way you would with any Sinatra/Passenger app. The structure and config file is already written, so you really just need to do the vhost and symlinking :

Happy Gardening!

Fun with Quartz Composer in Snow Leopard and the BBC Radio Schedule

posted by Duncan at 12:34 pm on October 7th, 2009

I’ve just posted on the BBC Radio Labs blog about some tinkering with Quartz Composer I’ve done. Please read the full article there, but in short, I’ve created a Quartz Composition that you can install as a Screen Saver, that reads in the BBC National Radio Schedule and rolls through each station showing who’s on and displays a pretty picture. Oh, and I think it all looks very pretty.

BBC Radio Screen Saver

Head on over to the Radio Labs site to download and install on your machine. Please note though, it’s for OSX 10.6 Snow Leopard only.

Controlling the spotlights at work with Sinatra and OSC

posted by Duncan at 8:47 pm on April 24th, 2009

Nic bought some spotlights the other week for work, so we could hook them up to our continuous integration server, and they would let us know using the medium of colour, when things had failed!

Before we did that, I thought I’d have a little play. Tristan and Chris having been building a fun new game (Read more via the Radio Labs blog soon) which uses nowplaying data from BBC 6 Music to power it. Knowing when a track is starting and ending is also useful, so as a bit of fun, I wrote a little Ruby script that made the spotlights behave like traffic lights:

  1. Green – when a track started playing
  2. Flashing Amber – when a track was about to finish
  3. Red – when the track finally finished

spotlightPhoto by Tristan

To control the lights we’re using ROSC open sound control for Ruby. It’s very good, but required building to install, and the interface is nice, but not simple enough if all you’re doing is turning a light on or off and changing it’s colour. So in order to make the script even more simple, I thought I’d write a little http proxy so that your could control the lights by just going to a url. It meant even the non-programmers could have fun replicating disco lighting. The urls look like this:

http://spotlights.local/all/green
http://spotlights.local/all/rgb120-12-200
http://spotlights.local/all/off
http://spotlights.local/all/random

The proxy is written using Sinatra. I love Sinatra. If you thought prototyping was simple with Rails, well with Sinatra + Passenger it takes simplicity to a whole new level.

You can download the lightcontroller source from Github as normal, you’ll have to tweak a few settings for your needs. You may even find it a useful template for controlling something else.

TellyBox 1.4, Twitter, Scheduling .. plus the coolest icon

posted by Duncan at 3:35 pm on March 22nd, 2009

[note] if you are updating and have the current app in your dock, you may need to remove it, and then re-add it again to get the new icon to appear straight away

I’ve just released a new version of TellyBox, version 1.4. This version pulls in all the new features from sister app RadioAunty, plus a few news ones specific to TellyBox.

If you didn’t know, TellyBox is a Mac app that allows you to watch live and catchup BBC Television (Uk users only I’m afraid). It uses the BBC iPlayer to actually display the telly, but wraps it all up into a native Mac application.

TellyApp screenshot

Like I mentioned above, new features include Twitter support and scheduling as per RadioAunty. I recommend reading this post to get more information on these. As well as them, the new features specific to TellyBox are:

  1. I have removed the default channel entry from the preferences. The app now just remembers what channel you last watched.
  2. The close button, and zoom buttons (red and green) now work.
  3. A brand new app icon (designed by David Wilson)

I’m really pleased with the icon. I know David spent a lot of time designing it, and for a first application icon, I think it’s awesome. I also knew the effect I wanted. I really liked the idea of the icon being a mini telly showing you exactly what you are watching in the main screen. It seems Mac icons can make or break an app, so I’m hoping this one can only help.

It’s actually quite a simple effect to achieve. It’s just about building layers. I use CGWindowListCreateImage to take a screen grab of what’s playing over time. When I have a new grab, I then construct the dock icon, using the grab at the bottom, then a version of the app icon with a transparent screen to give the glass effect, and finally the channel logo. If you minimize the app, or change windows using spaces, then the icon will change to the BBC test card.

Download TellyBox from the project page on Github, or if you already have the app installed, then you should get a request to update automagically.

RadioAunty feature update – twitter, scheduling and much more

posted by Duncan at 7:50 pm on March 14th, 2009

In my on going Cocoa learning I have been working hard on updates for RadioAunty. ( If you didn’t know, RadioAunty is Mac app that allows you to listen to live and catchup BBC Radio ). This means the feature list is now quite compelling, so I decided to give and overview of the features to date.

1. Select your Favourite Station – Choose from all the BBC National radio stations. You can listen to them in Normal RealPlayer or the much higher quality ACC streams. Make your decision via the preferences screen.

RadioAunty select a Station

2. Minimise the radio – I didn’t think people generally stare at the player whilst they are listening, so you can now minimise it like you can with iTunes, using ^ cmd Z or the window menu. You can also tweak the width whilst minimised. You will also see that the window title shows the current show playing. This updates along with the schedule as time goes on. More on this next.

RadioAunty minimized

3. View the schedule – In the Schedule menu, you will see the day schedule for the station you are listening to (using data from BBC programmes). You will see a tick next to the show you are currently listening. You will also see that some shows are clickable. This is stuff you can listen to, that is available to catchup in iPlayer, it also displays how long left that show is available in iPlayer for. This schedule updates as you listen throughout the day.

RadioAunty schedule menu

4. Twitter support and other preferences – The preferences window gives you the chance to change some of RadioAunty’s settings and turn on others. From the top, we have updates. Turning this on allows you to receive updates to the application when they become available. Next is default station. This allows you to choose a default station to open with (I think this may be removed next release, and the app will just remember what you last listened to. Next is audio quality. It’s best to stick to high quality, but those streams are only available in the UK, so if you are listening abroad you will have to choose normal quality. Finally Twitter support. Opting in means that as you listen, details about what you are listening to will be sent to the @radioandtvbot account on Twitter. If you supply your twitter username, this will be added to the tweet instead of the default, which is your computer login FullName. The screenshot below next shows you what gets sent.

RadioAunty twitter support
radioandtvbot

5. A nice dynamic app icon – The wonderful Tim Broom made the current icon. The icon changes, showing the network you are currently listening to.

Nice Icon

6. Growl support – If you use Growl, then RadioAunty will notify you when a show starts playing. If you choose the twitter support it will also notify you when this information is sent to twitter.

Growl Support

Next then. I’m going to be transferring the twitter and scheduling stuff over to TellyBox (A Mac app that allows you to watch live and catchup BBC Television). So watch out for the updates. Then I think lastfm integration is on the cards. It’s be nice to scrobble what tracks you are listening to.

Experiments in Cocoa #2 TellyBox

posted by Duncan at 3:26 pm on February 23rd, 2009

After my first foray into Cocoa development, which involved Radio, I decided to take what I had learnt and move into TV. Tellybox is the result. It’s a Cocoa desktop app that’s a wrapper for the BBC iPlayer live and catchup service for a day. I’m quite pleased with how it turned out.

[BY THE WAY] This is a personal learning project, and not affiliated with the BBC in any way. It (and I) only use publicly available information, in order to try and inspire people to just build cool stuff. If you think you could do better or have ideas in improving the app, please let me know. I’d love to hear from you.

Download TellyBox via it’s github project page.
TellyBox - A Mac app that lets you watch the telly

Below I’ve briefly noted the various features, and what areas of Cocoa I had to learn to implement them. I ‘ve added a long list of resources at the bottom, which have and continue to, prove very useful when developing in Cocoa.

1. Select your Favourite Station – You can select which channel you’d like to watch from the Watch menu. This involves reading in some .plist configuration data and displaying it in an NSMenu. The menu is drawn with code, and once understood, meant building and manipulating all the other menus was a breeze.

Tellybox station selection

2. Choose your viewing size – You can choose from a list of 5 sizes to view from. These sizes can be chosen from the View menu or the shortcuts 1-5. This sizes as well as the location of the display window are remembered when you quit the application. The resizing is using NSWindows setFrame:display:animate: to make it look pretty and is using NSUserdefaults to manage the remembering of the size and origin of the window.

Tellybox viewing sizes

3. The day schedule – Here you get a list of what’s on the day you are watching, and what is available to watch again. It also marks where you are in that day. I still need to work on updating this schedules as currently it only loads when you first start viewing, so won’t change automatically over time. The schedule data comes from BBC Programmes via XML and is parsed using NSXMLDocument. It uses the same caching policy as the BBC site.

Tellybox schedule

4. Growl Support – The app has Growl Notification support. If you have growl installed you will get notifications about what you’re watching. This was implemented with the growl documentation and uses the Growl Application Bridge.

Growl Support

5. Preferences – You can change a few preferences at the moment. One is the default Network that gets shown when you start the application. The other is whether you would like to receive automatic updates and how often you would like to check whether they’re available. The former uses NSUserdefaults and Cocoa Bindings. The latter uses the popular and amazing Sparkle update framework.

Tellybox - Preferences

Here’s a list of useful resources I’ve used to get to this point:

Finally a few things that don’t work so well. Well one at the moment really, and that’s guidance. I haven’t quite worked out how to get the iPlayer guidance stuff working in Tellybox, which means if the show you want to watch again has a guidance rating then the only way you can watch it, is to go to the web version. I’ll keep trying though.

I think that’s it. Hope you like it. I’m really enjoying Cocoa development at the moment and look forward to my next personal project.

Visualising our SVN commit history

posted by Duncan at 12:03 pm on January 30th, 2009

I saw a post on igvita.com the other day named Ruby Swarms: Visualizing Rails & Git. The visualisations looked really cool, so I thought I’d create one myself. It is created using the code_swarm software and doesn’t require much work to produce something cool, tweak a few config files and bingo!

This is a visualisation of BBC Radio & Music’s SVN commit history up until Dec last year. The massive explosions are people freezing Rails projects. The colours of the crosses reflect the type of file being committed, and the size reflects the size of the file. It takes a while to get going, then goes crazy!

CodeSwarm vs BBC SVN commit history


back to the top