Posted by andy
Following on from the XMPP stuff, I made a little site that just reads and output what’s playing on BBC radio. It is a toy app at the moment with no real point (and might well fall over), its worth putting on the DAB radio to see the sort of delay it might be experiencing.
mibly.com/radiofall
What is it using I hear you bellow?
- Ruby – well what else?
- xmpp4r gem – for connecting to the xmpp server and parsing the messages
- json gem – for outputting the messages in …. json
- jQuery – to make all those Ajax requests
The next steps are to add some intelligence into the script, interacting with some APIs or something. I have a few ideas, but it depends upon time and if I can get somebody to help with design.
Posted by andy
God bless BBC Radio Labs. They get to build some cool little things including a fun little XMPP server. Its pushing out messages that usually only get seen on the front of DAB radios. I whipped this ruby script together pretty quick (you can tell), but shows how easy you can connect to it.
require 'rubygems'
require 'ruby-growl'
require 'xmpp4r-simple'
username = 'myusername'
password = 'password'
domain = 'hug.hellomatty.com'
im = Jabber::Simple.new("#{username}@#{domain}", password)
im.status(:chat, 'Hello world')
g = Growl.new "localhost", "ruby-growl", ["ruby-growl Notification"], nil, "growl"
i = 0
while true
i+=1
if im.connected? == true
im.presence_updates.each do |friend, old_presence, new_presence|
if new_presence != nil
puts "#{friend.gsub("@#{domain}", '')} #{new_presence}"
g.notify("ruby-growl Notification", friend.gsub("@#{domain}", ''), new_presence)
end
end
else
puts '**************************** disconnected *************************'
im = Jabber::Simple.new("#{username}@#{domain}", password)
im.status(:chat, 'Hello world')
end
sleep(2)
if i == 10
im.reconnect
i = 0
end
end
Here is some sample output.
radio3: Details from bbc.co.uk/radio3 or call 08700 100 300.
1xtra: 1Xtra Dancehall Show - Robbo Ranx. Txt 88111 [network rates apply].
radio4: The World Tonight. Web - bbc.co.uk/news
radio2: Mark Lamarr. Mark presents the Shake, Rattle and Roll Show.
5live: Richard Bacon: Lively and provocative discussion regarding the day's key stories
Now I have no idea what I can do with this (twitter posting is already done to death), so I might have a think about this sort of thing. Be fun if it makes it into production.
Posted by andy
Over a friday night I rebuilt iPlayerlist iPhone templates so that it uses Joe Hewitt’s iui. The result is quick to navigate, no silly pinch zooming to get what I want. Just point your iphone/ipod at iplayerlist.mibly.com.
There is a slight problem that is getting on my nerves a little. When you want to view an episode you are redirected to bbc.co.uk/iplayer. I had to do this as the iPlayer site uses mp4 embeds that are protected by a couple of layers of user agent strings and cookie validation. So, although I attempted a some rather hackey iframes, a link to iPlayer seemed to be the best option.
Building this version which emulates the iPhone system ui made me want to build a version using the Apple Touch SDK. I fear that getting my head around Objective-C might just take too much time. Would be damn cool though.
Anyhow give this a go and see what you think of it.
Posted by andy
I got hold of a Wii this weekend, mainly because of Mariokart but also so I could faff around with its browser. The result is iPlayerlist for the Wii (thank you BBC). Again, its work in progress and consider it to be my programming play thing rather than a fully fledged service.
Its a shame the little Wii cant handle anything more than Flash 7, as its a bit blocky and clunky for video playback, worth a try though. Just point your Wii at http://iplayerlist.mibly.com.
Update
I’ve put a PS3 user agent look up in there too. So PS3 users can have a play, a la ps3iplayer.com
Posted by andy
Its nice to have a project that you dabble with as a hobby. A project that even if it fails, you won’t lose cash, job, respect or pets over and can only really gain through lessons learned. Currently, my hobby project is iPlayerlist.
I started to build iPlayerlist as I wasn’t a fan of the original bbc.co.uk/iplayer site. It didn’t group episodes by series, rather graphics heavy and required too much clicking about for my liking. So over a Christmas, I began writing some code that would give me something I would use, but also as a vehicle to play around with some APIs that are about.
I’m happy with the result in that I use it and have learned stuff through developing. If anybody else uses it, its a bonus.
Anyhow, “Whats in the pot?” I hear you ask. Well here are the services the site uses.
These services all contribute in a way. The BBC iPlayer site is screen scraped (yeah I know, I know, but there are no RSS feeds or API yet so I had to). We grab a little more information from /programmes relating to each episode such as descriptions and broadcast dates. Then for each series we search youtube via its API for related videos. We then get some related blog posts via Google Blog Search. These blog results are passed through Akismet to reduce the spam, then moderated by myself.
For all this to happen Rails 2.0.2 handles the donkey work with the following
There is loads more I could ramble on about here, but I’ll leave that for another post.