Widgets

Of late I’ve got round to installing a few widgets on my computers – Dashboard on my Mac and Yahoo Widgets on Windows (no linux widgets as yet). I’m actually still running OS X 10.3.9 and using the very nice Amnesty to allow run to Mac Widgets.

I’ve been meaning to play with widgets for a while, mainly because I’ve been using HTML, CSS and Javascript for years and widgets simply reuse these technologies – making it easy to just jump in an make something handy. I’m also a fan of web services in general and widgets provide another handy interface to many online services.

I’ve mainly been using the Junior Mint widget (and Minty) for keeping an eye on my site stats, I think I mentioned before I’m hooked). I’ve also been using WiFi monitoring widgets, battery monitoring widgets and looking at the backpack widget which looks nice.

As for having a go at developing them – I just made available my first go, a widget to keep track of the @media2006 feed agregator I have built. It’s relatively simply – it polls the site for a couple of variables and displays them across a couple of panes. The numbers in question are the total number of posts, the number of new posts this week and today – as well as a countdown to the event. I had to do a little work to expose these properties in an XML format from the site but nothing major.

I learned by looking at a couple of tutorials as well as existing widgets. Disecting code prooved the most useful – the majority of tutorials seemed to provide good Hello World examples but you could probably guess most of that. If anyone has any good intermediary or advanced widget tutorials then let me know.

The main problem with the development process was definately the iterative testing. With web pages I tend to work in large steps (with very little testing) early on and then move to more small changes and quick testing later on when it’s down to the details rather than the brush strokes. I’d definately echo the sentiment of others by testing in safari (it uses the same rendering engine) first, and also add that getting all the markup and CSS in place before moving to Javascript is probably the best bet. You really need to test the Javascipt with a real running widget as it has it’s own functions available via the widget object. I’ve heard Apple may be working on a suitable IDE for widgets (my guess would be a tie in with Xcode) and I’ve come across Wcode which appears to offer some useful tools.

I’ve not yet looked into the situation with Yahoo Widgets – I intend to port my @media widget to Yahoo as an experiment and we’ll see how that goes (and yes I know that’s the wrong way round – Dashboard was, to some, a copy of Konfabulator, now Yahoo widgets. It’s early days I think for widgets – the move to more of a distributed systems feel, with open APIs and web services, amongst modern web applications would seem to be a perfect match for small desktop applications that tie into them. Watch this space.