Talking to wikipedia

With Js



How do you access wikipedia programatically ?

Mediawiki Api

(List of all the available options)

(List of client libraries in various languages)





Who doesn't use a browser !

Lets use javascript to talk to the API 


Have you guys written js before ?


Heard of events & callbacks ?

Lets play with the API


Without writing any code yet :-)

Lets pick a task


  • The authors of the first 100 edits in an article 
  • Read the edit comments in an article
  • The list of images used in an article






I'm sure you guys have better ideas :-)

Userscripts


Userscripts are available directly in a wikipedia page.
They can do a lot of nifty things for you.



A tool I built with the API


  Demo




thank you


Events



Callbacks


Functions are objects in javascript.
They can be passed to other functions like variables.

Ajax


Ajax is Asynchronous Javascript & XML.
The callbacks don't get executed right away.

Callback Nesting


jQuery when() , then() & done() 

Talking to wikipedia

By cosmiclattes

Talking to wikipedia

  • 1,327