The Library

Get the code

You can grab the (incredibly lightweight) wikipedia.js library from here.

Want to browse the annotated source?

The library is the work of Open Knowledge Foundation Labs and Rufus Pollock in particular. It is, in essence, a small wrapper around the data and APIs of the DBPedia project and it is they who have done all the heavy lifting of extracting structured data from Wikipedia - huge credit and thanks to DBPedia folks!

Using it

// first include the script
<script src='http://okfnlabs.org/wikipediajs/wikipedia.js'></script>
var info = WIKIPEDIA.getData('http://en.wikipedia.org/wiki/Invasion_of_Normandy');
alert(info.summary.title);
console.log(info);

Or, check out the more detailed demo below ...

A Demo

This simple demo uses wikipedia.js library to load information on the given page and display it below. The JS source for the demo is here while the HTML source is just this page!