Thursday, March 10, 2005

Autodiscovery and Location Aware Web Pages

Autodiscovery describes the way in which machine readable metadata can be extracted - and exploited - from a webpage. The key to it all is the humble <link /> tag, though when the spec. was written things like RSS/Atom autodiscovery were presumably as yet unimagined...

...and so it came to pass that autodiscovery came to prominence with the rise of the blogs, as this early blog posting suggested it might, and this posting shows how it has come to do so...

Autodiscovery is not just limited to RSS/Atom though. FOAF Autodiscovery aims to promote the development of Friend of a Friend (FOAF) social networks by making FOAF records machine discoverable/readable.

The development of web technologies thrives on reuse - and tools that make reuse easy. If you want to generate a bookmarklet to assist you with autodiscovery from a <link /> tag, try this autodiscovery bookmarklet generator. With almost no effort, you can generate a bookmarklet that learn something from a suitably <link /> augmented page...

...which is where the Location Aware Webpage comes in...

The prototype is very, very simple... add a link tag to the head of the page containing the postcode of where I'm at:

<link rel="postcode" type="text/html" title="mk7 6AA" />

(In the US, this would be a zip code, of course...but this is just the first prototype, remember...)

Now for UK Postcode Map bookmarklet straight out of the generator:

javascript:void(d=document);
void(el=d.getElementsByTagName('link'));
for(i=0;i<el.length;i++){
if(el[i].getAttribute('rel').indexOf('postcode')!= -1){
var newlocation='http://ouseful.open.ac.uk/postcode/';
var foaf=el[i].getAttribute('title');
void(location.href=newlocation+foaf)
};
};


This code makes reuse of the http://ouseful.open.ac.uk/postcode/ redirector, which takes a UK postcode as a final argument and redirects it, with suitable GET sugar coating, to Multimap.

So, to see what happens, grab the bookmarklet, place it on your toolbar, then (as long as this page at least is loaded) try it out...hopefully, you'll see where I'm at as I write this page...

So, where next?

A zip code equivalent for the US, a Firefox plugin so there's a little button, like the RSS subscribe button down in the bottom right hand corner, to launch the autodiscovery location map plotter, a user dialogie to choose your locale (and hence your map plotter) and so on...

Any volunteers? ;-)

0 Comments:

Post a Comment

<< Home