Widgets

Widgets arise everywhere

Presentation

Widgets can be found everywhere Konfabulator (renamed Widget Engine by Yahoo), Dashboard, Google Personalized Home Page, Firefoxit, Kapsules, Netvibes...

Finally a promising engine for Linux is Jackfield. As a matter of fact the ancestor of all those engines is SuperKaramba (first public version in 2003) followed to my knowing by gdesklets. But they require deep python coding to build a widget while new engines define a clean api for javascript entertaining development.

Javascript was overlooked by many among who you can count me as a trivial language. Just good enough for a quick hack on client-side. Nowadays javascript is the foundation of the Web 2.0. Javascript is quite a must now. So it could be the reason why the engines that choosed this language at their heart are winning.

The definition of the concept of widget is outside my scope but I can share the ideas behind them or at least the ones I found interesting !

Backpack javascript API

As I wantad some elements of my backpack pages on my desk I started designing a konfabulator widget of my own.

Impressed by the ruby api I tried to figure out a way to map it into javascript.

I used javascript objects to build a clean implementation. The api is quite easy to use as shown in the example below:

          var connector = new Api("login", "40-digit-backpack-secret-key");
          var pages = connector.getListPages();
          for (var i=0; i < pages.length; i++) {
            print "Page title for page #"+i+" is "+pages[i].title;

            var items = connector.getItemsOnPage(pages[i].id);
            print "Found "+items.length+" on this page";
            for (var k=0; k < items.length; k++) {
              var item = items[k];
              print item.toString();
            }
          }
        
This sample fetches the list of pages found on a server with your login and secret api key. Then for each page it shows item elemente on the page.

Download

v0.1 first version - 01/13/2006

This implementation of the backpack api is neither complete nor completely tested. I successfully used it to play with items on backpack pages.

Screenshot

Here is a screenshot of my Konfabulator widget showing test items from two lists on a backpack page.

screenshot of item elements