After a well needed break, spent mostly on a sun lounger reading Masterminds of Programming (Fantastic book if you truly enjoy your code!), The Art of Lean Software Development (A real eye opener and highly recommended) and The Productive Programmer (Common sense for experienced developers, but an easy enough read to help refresh your memory), I arrived home a few pounds heavier than when I left, eager to release the creativity from my well rested brain.
While on holiday I managed to pay a visit to the gym (one day it rained
), where I stumbled across an ergometer that is quite simply an impressive piece of engineering!. At first glance the rower looks solid and unobtrusive, however the minute you start to row, you can tell that a lot of work had gone into designing this machine. From the super smooth whir of the flywheel, to the instant gratification from the console, I was hooked and just had to have one!.
It took me a while to finally track down the model (I couldn’t find it in the high street), but after trawling Google images for rowers, I finally found myself at the Concept2 website. It came as no surprise that the Concept2 is regarded as the world’s best rowing machine, and after buying mine from their site I have to agree with that statement.
So what’s rowing got to do with Open Source anyway?, well one of the cool things about owning a Concept2 rower is the ability to log and validate your rowing time online. Doing so allows you to take part in the many challenges offered (I’m looking forward to Skeleton Crew) and compare your ranking with other rowers around the world – rewards help motivate you and keep you rowing!.
It was while I was updating my Online Logbook that I began to think about adding my current progress to this site and wondering what the best method of presenting that information would be. Concept2 are working toward a web based API to access stats, so if I wanted to embed my progress in the meantime I would need to parse the current ranking page.
I started off looking at Javascript, as I knew that most browsers support the language and it would not require any server side code. Finding a decent progressbar that had a nice API and worked well in most browsers, however, proved to be tricky.
I remembered that the Open Source Adobe® Flex® Framework has an easy to use progressbar, and with Adobe Air targeting the desktop I could run the widget on the desktop if needed.
It’s been a while since I last played with Flex, but I am still impressed with the simplicity of MXML and how easy it is to get an working app in no time. Within minutes I had a working widget, my only issue was that when I uploaded to the website, the actionscript that parsed the logbook page failed due to a sandbox violation. A common issue that is easily fixed by uploading a cross-domain policy file to the website you want to access.
Not something I wanted to request, so I just resorted to mirroring the page on my own site for now – good old Wget and Cron.
Adding the app to the site was no trouble either, with the help of SWFObject only a few lines of html are required to embed the app and handle any cross browser Flash issues. If you want to see just how easy Flex is to work with, check out the tutorial on the wiki for details on how the widget was built.
Of course that’s just a start, there’s loads more features that could be added to the widget and if parameterised / themed it could also be shared with other sites – watch this space!.
While working with Flex / Flash I also stumbled across Zero Clipboard, a cool library that allows you to access the clipboard via Javascript – AuthStor now has 1 click copy, a feature that cut out several steps required to copy a password and ensures that nobody can snoop over your shoulder.
Right back to rowing, I have 976433 meters to go before I make it into the Million Meter Club!.

















permalink



