Greasemonkey as a lightweight intermediary
In The architecture of intermediation, Jon Udell discusses the need for a mechanism for a high-level tool for adding custom features to web applications. In Jon’s case, he wants to add a private bookmarks feature to del.icio.us. Jon thought about using a web proxy to intercept and modify del.icio.us pages, but ruled it out as too low-level.
Jon, you need Greasemonkey.
The latest release of the swiss army knife of Firefox extensions adds support for cross-domain XMLHttpRequest calls from greasemonkey scripts. What that means is that you can create a user script (a short JavaScript that will be executed whenever your browser loads specific pages) that can then pull extra data in from another server. This new ability is described in the greasemonkey documentation.
I’m using this for my final year project, a decentralised web annotation system that lets you annotate pages, storing your annotations locally and then sharing your public annotations as a feed (similar to the way RSS aggregators work). The trick there is to run a local web server on some port, then have the Greasemonkey user script (eventually a full extension) communicate with that local server to store and retrieve data. I’m using Ruby on Rails’ built in WEBrick server to prototype the service, and it’s working a treat.
This architecture could be easily adapted to add private bookmarks to del.icio.us—or to add any number of cool features to any number of other sites. Here’s another example: Google’s Desktop Search integrates results from your local drive with the search results page on Google. Using greasemonkey and a local web server tied in to OS X Tiger’s Spotlight indexer, you could add this functionality to any search site you wanted to. Just be sure to lock down the web server to only serve requests from localhost, to avoid sharing search results for your data with anyone on the network who can see your machine.
When people asked me what I was excited about at SxSW, one of my answers was Greasemonkey. This kind of stuff is the reason why.
Interesting, Simon. I've been thinking about this as well for sometime since I first heard of Annotea (though admittedly haven't got around to actually trying anything with it).
Is there a reason you'd want to share via a local server though? Why not automatically upload it to a previously existing publicly available server rather than a local one? Then it could just be an extension of your blog, available as another feed as you suggest. I'm interested in seeing what you do with it, but running another server locally really doesn't appeal to me (though I am only one person)
Derek Featherstone - 30th March 2005 21:46 - #
Michael Moncur - 30th March 2005 22:25 - #
Simon Willison - 30th March 2005 22:38 - #
Jeremy Dunck - 30th March 2005 23:09 - #
Michael Moncur - 31st March 2005 05:26 - #
Rui Carmo - 31st March 2005 10:29 - #
I wrote a web annotation system for my final year project too (at ic.ac.uk).
It used a Konqueror plugin + KHTML hacks ( this harks back to KDE 3.0).
So my system had the following features:
A bunch of other stuff. I'd be glad to discuss it, mail me.
My plans were to expand it to cover things like distributed ad-cutting from recorded TV shows by commenting on where the ad starts, and also to distributed map making by commenting on locations. It would also be possible to do distributed auctions, etc. But I'm lazy...
rjw - 31st March 2005 12:31 - #
How does it compare to iMarkup (via http://slate.msn.com/id/2114791/ )?
Julien Couvreur - 31st March 2005 23:34 - #
There's local annotation to semi-automatic annotation.
The WonderWeb IST Project (Owl) [Report]:
This has an obvious collaborative tie to semantic web objectives for the working group.
Also why don't you embed a rich text editing environment to your comments editing pages that checks for well-formedness instead of commenters having to write all this sugary tag stuff to make it look half-readable?
Amit - 5th April 2005 11:56 - #
Bart - 7th April 2005 22:54 - #
Steve Malllett - 5th June 2005 20:36 - #
I'm working on server-based web annotation for Moodle using a similar AJAX-based approach. In my case, annotations are displayed in the margin alongside highlighted ranges of text. I am very curious to see your code: when I first heard of Greasemonkey I immediately thought of annotation, but I haven't pursued it yet.
Geof - 15th June 2005 22:59 - #
Darius - 6th August 2006 22:03 - #
Share Trading - 26th September 2006 02:23 - #