Beanie Big Ben
Post made about 11pm on 3rd January 2010 (a Sunday).
No brave souls have yet left any comments for this one.
Posted under Uncategorized
As a little experiment, I spent a little time investigating Google App Engine, with a view to setting up a Twitter bot that could fulfill this off-hand wish.
It transpired that Google App Engine is remarkably easy to use. On Mac OS X I just needed to install the App Engine Launcher, configure it to use TextMate as an editor, hit ‘Edit’, and get to work. You pick an unused app name, and it gets deployed to [your_name].appspot.com for free. Oh, how do you deploy? Hit ‘Deploy’.
So it’s perfect for setting up a little application to do something very small (although, if your situation demands, you can also run the Django web framework on there, or indeed anything that’s either in Python or in a language that can be compiled into Java bytecode). With just a handful of lines of YAML you can set up cron tasks (i.e. run scripts every, say, 9am on a weekday, or whathaveyou), which work by making an HTTP request to a given place at the allotted time. If you’re just making a little Twitter bot, it couldn’t be much simpler.
So the idea was to create a little mash-up of the @big_ben_clock Twitter account (which just goes ‘BONG BONG’ etc every hour, like any good bell in a tower would – except on New Year’s Eve when it went ‘BANG! BANG!’) with the idea expressed with eloquent laconicity on Do Websites Need To Look Exactly The Same On Every Browser. As Andy Clarke put it recently, “The real question is not should web sites look the same in every browser but can they? The answer is no. Live with that, move on.” The unchallenged assumption, borne of the practice of web designers getting design sign-off from clients on the basis of static visuals alone, is something that, in 2010, is one of the biggest factors holding back quality web production. It needs to be a truism that there is no expectation that interfaces should be the same everywhere – and rather, ultimately, that interfaces are already or will soon be actively expected by users to mould themselves to the context in which they appear. So this Big Ben is a web standards advocate, who wears a blue beanie, in reference to the cover of Jeffrey Zeldman’s ‘Designing with Web Standards‘.
So, @beanie_big_ben was born:
You get the idea.
The only mild issue faced getting this up was the lack of available syntax for defining when cron scripts can run. You can run them every hour, but there’s no way of determining which minute of that hour they’ll run. So I went the route of running them every minute, and having the script just return early without making an API call if it isn’t within a minute on the hour. Sounds inefficient, but we’re only talking the dinkiest little script.
This also unearthed the probable reason why @big_ben_clock sometimes neglects to BONG in particular hours – it probably works on Google App Engine too. If you set a cron script to execute every minute on the App Engine, it’ll actually execute about every 62 seconds, which means that about every 30 hours it won’t execute within the minute after the hour, but just miss either side of it. Tant pis, or even bof, as the French may say.
Beanie Big Ben also can do requests, if you have a burning web issue for him to pronounce upon. (Either leave one in the comments or tweet him up.) Twelve times “IT DEPENDS” can just fit under the 140 characters – he’s not afraid to fence-sit! Let him know.
