The release of the Kynetx Annotation V2.0 framework provides us with an extensible and feature rich API for the building website mashups. Out of the box the Annotation framework will enable you to develop mashups on Google, AOL Search, Bing, Yahoo! Search, HotBot, Ask.com, AlltheWeb, AltaVista, Facebook and LinkedIn. With just a bit on configuration the framework can eazily be extended to work on other websites not supported by the default configuration. Three basic patterns of annotation are now supported by the framework: local, remote and event.

Below are working examples of each of the three basic annotation patterns. Links are provided to both the KRL source code at GitHub and browser extensions for you to install. Many thanks to Cid and the Kynetx Team for providing us with this awesome annotation framework!

Local JavaScript Annotation
Using local Javascript annotation you provide the annotation framework with a Javascript callback function that will be envoked after the data is collected from the web page. The Javascript callback function will be passed a reference to the item which is under consideration for annotation, a wrapper div element which you can use to for annotation, and the data collected from the web page which you can use to determine how to annotate.

The Kynetx KRL source code for the local JavaScript annotation example in the documentation is available from GitHub. You may also take the example for a test drive by download the browser extension for Firefox, Internet Explorer or Chrome.

Remote Annotation
Remote annotation enables you to call a remote services to determine which items on the web page will be annotated. The remote service will be called using JSONP. The remote service will be passed a list of items, each will contain an item reference, the full URL of the item (e.g. http://live.gnome.org/Cheese), and the domain name (e.g. live.gnome.org). The remote service should return the list of items to be annotated, each with the item reference and any values to pass to the Javascript callback function as data parameters.

The Kynetx KRL source code for the remote annotation example in the documentation is available from GitHub. The source code for the web service is also available from GitHub. You may also take the example for a test drive by download the browser extension for Firefox, Internet Explorer or Chrome.

Event Annotation
The Event annotation pattern is truly the most interesting and powerful of the three patterns. By using the Kynetx Web Event Action the framework fires a rule back on the Kynetx Server, which can either directly annotate or provide data for the annotation to be performed by a local Javascript callback function. The rule is passed both an annotation reference and JSON structure which contains the data collected from the web page by the framework.

The Kynetx KRL source code for the event annotation example in the documentation is available from GitHub. You may also take the example for a test drive by download the browser extension for Firefox, Internet Explorer or Chrome.

It is also possible to directly add an annotation from within the event rule which is fired. So instead of making additions to the JSON data structure, simply call annotate:add_annotation. The Kynetx KRL source code for the javascript annotation via event example in the documentation is available from GitHub. You may also take the example for a test drive by download the browser extension for Firefox, Internet Explorer or Chrome.

Enjoy!