The program below works for en.wikipedia.org but for openwetware.org it outputs "Got: undefined" and this is the actual response returned from the server:
{"warnings":{"main":{"*":"Unrecognized parameter: rand."}},"batchcomplete":"","query":{"pages":{"-1":{"title":"Main%20Page","invalidreason":"The requested page title contains invalid characters: \"%20\".","invalid":""}}}}
#!/usr/bin/env node
var mw = require('nodemw');
var client = new mw({
protocol: "https",
server: "openwetware.org",
path: "/w",
debug: true
});
client.getArticle("Main Page", function(err, data) {
if(err) {
console.error(err);
process.exit(1);
}
console.log("Got:", data);
});
The program below works for
en.wikipedia.orgbut foropenwetware.orgit outputs "Got: undefined" and this is the actual response returned from the server: