Searching Wikipedia using the MediaWiki Action API

 

WikiSearch.java uses the MediaWiki Action API to search Wikipedia.

The user supplies a string of keywords, and matching page titles and short snippets from each page are listed.

WikiSearch.java processes its command line arguments using the Picocli library, which I've described in more detail here. The JSON data returned by Java's HttpClient is converted to objects using Google GSON, with the mappings defined in WikiResponse.java.

 

Some Pictures

WikiSearch help:

[help PIC]

A search for "wilmslow":

[search PIC]

A search for "imperial college" that also displays the fourth match (v 4):

[view PIC]    [browser PIC]

 

Downloads and Links

 

Dr. Andrew Davison
E-mail: ad@coe.psu.ac.th
Back to my home page