I’m finally successful in pulling data using the Wikipedia API, but there’s something I really don’t understand, and I can’t seem to find the answer.
I’m using this to query data:
var title = "Fort_Capuzzo";
$.getJSON("http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=timestamp|user|comment|content&titles=" + title + "&format=json&callback=?", function(data) {
console.log(data);
});
This returns an object which I can of course drill into to pull what I need. However, nowhere in the documentation does it state which parameters to use to pull specific data from within the content. To be more specific please view this wikipedia article: http://en.wikipedia.org/wiki/Battle_of_Madagascar
Say I wanted to pull the date, location, and perhaps result for that battle only from the right module on the page. How would I do this?
Thanks for any help!!
I used FireBug in Firefox to take a look at the object returned.
so the above alerts out i “Magus732”
From there you can take a look at the returned structure and come up with code to grab the details.
edit
As far as parsing that goes, you may need to apply some clever css using jQuery or regular expressions to format it correctly and hide stuff you don’t need.