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 !
- Widgets bring you information to your attention in an unintrusive manner. They sit on your desktop waiting for a glance from you. Even if you don't look at them you see them and they can arise your attention on a particular piece of information. A RSS reader sitting on the desktop is one of the most valuable services. This kind of communication has been already recognized as one of the means to enrich a human-to-machine interface.
- Widgets can bring you your information wherever you are. Nowadays your digital life is scattered over many services and servers. As it might not be easy or even practical to depend upon only one service and provider the solution is to build a virtual view of your digital world at your finger tips. This way each widget is a window to a different part of your digital life.
- Widgets are also a quick way to build the little application you are lacking.
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.
- HTTPS protocol handling is not tested as I don't have this kind of access for my backpack pages.
- Handle Page objects, Item objects
Screenshot
Here is a screenshot of my Konfabulator widget showing test items from two lists on a backpack page.