Branding 0

Posted by andy

Hmm, if I go to watch an episode of the News at Ten on iPlayer I see.

  • The BBC logo
  • The iPlayer logo
  • The BBC One logo
  • The BBC News logo
  • The News at Ten logo
  • A 15 second video TV station identifier.

Not sure if thats right or wrong, just something to think about.

iPlayerlist is back, less sucky and smells of lemon 0

Posted by andy

Ok, I was stunned by the new iPlayer site to such a degree that I let iPlayerlist die for a bit. However, after a few people got in touch asking me to carry on I thought I best had do. So its back!

There really isn’t too much different than the old one from the face of it, but underneath its brand spanking new and loads cleaner. This is mainly thanks to iplayer now outputting Atom feeds. Thanks for that :)

One of the coolest things I’m working on is the idea that a user can sign in and subscribe to a given series. It’s actually up and running now, but not really ready for the whole world yet. Here is a link to what I’m currently watching on iPlayer.

Now that sort of thing opens the door to a whole raft of cool code writing fun. Suggestions welcome btw.

Pop under hell 0

Posted by andy

an example of a very broken site

I wish people would stop doing this. Makes me mad.

iPlayer v2 is wonderful!

Posted by andy

I have to hand it to the people at the beeb who work on iPlayer. The new site is loads better and putting radio and TV together is what I really wanted to see more of. So well done all around, it’s brilliant.

What does this mean for iPlayerlist? Well, I’m not sure, I still use my little site as I do like the lo-finess but to be honest, the new iPlayer site is much better for everybody else.

Perhaps I should change the tagline to “making the unmissable, slightly shitter”?

Should I bother continuing to maintain it?

The popularity of the features iPhone and iPod version of iplayerlist is making me think that I should. The fact that most users of the site are using these apple products is rather interesting. Getting linked from apple.com must have done something (grin), but the fact that they keep returning must mean its doing something right.

So I’m torn. Should I go on to try something else, or try and fix this for more devices and other such shenanigans?

Server changes

Posted by andy

I’ve kinda changed the whole platform mibly.com is running on. I’ll outline here what’s changed and why.

Source control iPlayerlist and some other projects I’m involved with now use Git, rather than Subversion for source management. The Rails core team have also moved over. So being the Technology magpie I sometimes am I jumped on to the latest shinny thing. Github. My code is now stored at Github, and I deploy from there too. It’s such a nice interface and nice not to have to worry about setting up repositories and deal with user management.

Application server The old server used to run on Apache 2 front end with 3 mongrel instances in the background. 2 for iPlayerlist and one for this blog. It was a pain to set up and rather limited. Since then however, Phusion Passenger, a.k.a. mod_rails has come on leaps and bounds. Its fast, spawns new threads when needed and easier to use and to implement. I now Passenger along with apache2. yay.

Deployment The old install used Capistrano. So does this one, as its lovely. However, I’m now up and running with the latest (version 2 strain) of Capistrano with support for Git. A little bit code is added to help Passenger to gracefully restart after all my code is checked out from github.

Host I’ve moved from slicehost to get a larger 512mb slice at railsplayground. It was a bit of a bargain and to be honest, 256mb can be a bit limiting when it comes to RubyGems and passenger.

iPlayerlist gets a little love

Posted by andy

Lots has happened since my last post. I’ve moved to a new server and suffered domain name issues. However on the positive side, I’ve had a little spring clean of iPlayerlist.

One of the big things I’ve added is the “featured episodes” on the front page. Now this is mostly powered by what appears on the front page of bbc.co.uk/iplayer. However, there is a little twist. The featured episodes are also powered by the reviews posted upon the rather ace Watchification blog. When an episode gets mentioned by that blog it will become featured, and a link to the review will appear on the episode page. Thanks to the people there for letting me do this :)

Thats about it for now. In the next week or so I’ll be putting up a re-factored version of the back end, which should get rid of those annoying bugs that keep cropping up. Or I might do a bit of it at the BBC Mashed event.

Radiofall

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.

BBC Radio Labs and XMPP

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')

#  This bit just adds a few radio stations.  Should only be run once for your user
#
#  %w(radio1 radio2 radio3 radio4 5live 6music radio7 1xtra).each do |r|
#    im.add("#{r}@#{domain}")
#  end

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
    # reconnect every now and then as we seem to be having odd issues.  a bug really
    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.

Custom validation with Paperclip

Posted by andy

In my rails apps I used to use attachment_fu for uploading files, but of late I have moved over to thoughtbots Paperclip plugin. Its perfect for most instances, and indeed simple to use. I required it to do a little more than it can do out of the box. In my case I needed to check that the uploaded document was a well formed XML document. The result was a nice little custom validation method levered into the plugin.

# lib/paperclip_mixin.rb
module Paperclip
  module ClassMethods
    def validates_attachment_valid_xml name
       require 'xml/libxml'
       @attachment_definitions[name][:validations] << lambda do |attachment, instance|
         if attachment.file.nil? || !File.exist?(attachment.file.path)
           "must be set" 
         else
         # check file is valid xml
           begin
             # use libxml-ruby gem to do basic check on the file
             parser = XML::Parser.new
             parser.string = File.open(attachment.file.path).read
             parser.parse
             return nil # i.e no exceptions equals validity
           rescue
             "must be a valid xml document" 
           end
         end
       end
     end
  end
end

Then initiallise this patch it in our initializers.

# config/initializers/custom_requires.rb
require 'paperclip_mixin'

Now we can just add this validation method to our model that is using paperclip

# app/models/asset.rb
class Asset < ActiveRecord::Base
  has_attached_file :config_file
  validates_attachment_valid_xml :config_file
end

And that worked fine. yay.

iPod and iPhone version of iPlayerlist 1

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.

Home Episode

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.

Giving twitter a go

Posted by andy

I finally understand the point of twitter. It’s just a tiny status update of your life that anybody can see. Simple, useful and fun. It took me a while … but now I’m a bit hooked

http://twitter.com/mibly

A plea to the twitter team. I consider twitter to be feature complete, please don’t “do a facebook” and clog it full of vampire bites/IM clients and super fun tweets pro. Keep it clean, keep it crisp.

Time for a Wii

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.

iPlayerlist on the wii

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

Mixtapes

Posted by andy

Stumbled upon this awesome little site today that allows users to create online mixtapes. Yay retro. Mixwit uses seeqpod to find and play its music via its very easy to use flash app. I fear it won’t bring back the glory days of the mixtape, but its still rather cool.

This is making me want to go watch “High Fidelity” one more time.

A little about BBC iPlayer, youtube and playing 3

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.

Why I'm shit and need to know more

Posted by andy

Its rare for a developer to talk about their weaknesses on the internet. It can damage their next job opportunity. However, fuck that, here is what I need to improve upon as I suck in these areas.

  1. Regular expressions
    Its a fucking travesty that I don't know regex inside out. I get by, but I'm no super hero.
  2. Python
    Never dabbled with it. I have moved from java to php and now Ruby (with a spattering of others in between). Python is one of those languages that looks awesome and enjoyable to arse around with.
  3. SQL advancement
    Many people boast that they know SQL. I could state that I do. However I feel that I should know more advanced SQL, looking at streamlining my code much more.
  4. C
    I, for my sins never learned C at university. I did history instead. *puffs on an invisible pipe*
  5. Some Microsoft pap
    I have never learned VB, nor Basic nor ASP. I don't know the suited "certified" world of Microsoft. This is wrong, I should at least try and use it, it can't all be bad.
  6. CSS
    I sodding hate IE 6. I should learn some CSS techniques that prevent me from foaming at the mouth and swearing at Bill Gates.
  7. Java web systems
    A mystery to me, although I understand its awesome power and "enterprise" deployment worth.
  8. Flash
    Flash is awesome at some things. Notably video delivery. I should play more with that.
  9. Growing hair
    Unix == Beard
    Flash == Ponytail
    Fortran == Sideburns
    Ada == That weird hair that comes out of your ears when you are old
  10. Realise that you shouldn't do all of this list and specialise a little ....