Skip to content

getArticle not working with special characters in title #141

@Juul

Description

@Juul

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);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions