Archive for August, 2007

08.01.07

Sail on silvergirl, sail on by

Posted in General Ramblings, Mac at 8:33 pm by kkj

Vacation time and the weather still sucks … DMI and Accuweather both agree on this and almost with identical forecasts :-) . At the same time I’ve been struck by a frenzy, a crazed state of widget-mania ignited by my recent success in the field *coughs*. Talk about being stuck between a rock and a hard place …

I often travel from Ã…rhus to Copenhagen by car and whenever I remember to check the itinerary the day before and actually get up in time I choose the short cut by ferry to Zealand. This gives me an hour to doze or read while digesting the possibly most expensive breakfast in Denmark. That is, when I remember to check the schedule.

The ferry I take is operated by Molslinjen who offer up-to-date travel information in HTML and WML. I’ve bookmarked the WAP link in my cell, but thought it would be nice to have a widget that displayed the same information as well. As an added bonus that would mean having a fairly decent project on which to experiment with AJAX. Enter: The Molslinjen Widget:

The widget uses the Javascript XMLHttpRequest object to retrieve the current itinerary in WML format asynchronously whenever the Dashboard is displayed. You can switch between the different routes by clicking on the headline, and get to the not-so-informative back page by clicking on the info icon, which appears when the mouse rests over the widget.

For some reason, the WML offered by Molslinjen is not well-formed. My cell phone doesn’t seem to mind, but the XMLHttpRequest object choked on the XML and I had to perform a bit of string replacement to work around the problem. If Molslinjen ever decides to remedy this shortcoming, my widget will break.

Oh and I should mention: Molslinjen is not involved in this project. You can use the widget at your own peril as long as you leave me out of it, should you miss the ferry anyway.

Sail on by!