guiwp guiwp - 10 months ago 72
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Ă¡".


As this feature is now implemented we can simply:

client.getArticle('foo', true, function(err, data) {       
    if (err) {
    // ...