guiwp guiwp - 1 year ago 120
Node.js Question

How to deal with redirections in nodemw?

Its a library specific question... The library that I'm trying to use is nodemw (at the moment, I think, the most complete nodejs module for MediaWiki API).

How can we use the simple function named getArticles to follows the redirection of a page and directly get its content?

Ex. some pages we see just the following wikicode:

#REDIRECT [[Page name#Section title]]

In portuguese Wikipedia, we can see one example: if you type "Abacaxi" you will be redirected to "AnanĂ¡".

Answer Source

As this feature is now implemented we can simply:

client.getArticle('foo', true, function(err, data) {       
    if (err) {
    // ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download