kanasimi / wikiapi

JavaScript MediaWiki API for node.js
https://kanasimi.github.io/wikiapi/
BSD 3-Clause "New" or "Revised" License
48 stars 6 forks source link

Connection to LinguaLibre.org via Commons ? #11

Closed hugolpz closed 3 years ago

hugolpz commented 3 years ago

Hello Kanasimi,

I tried to create a minimal bot to contribute to Wikimedia's LinguaLibre.org. Login fails. I suspect it's because it has delegated login to Commons via Oauth. I am confuse on how to connect for log in, how to connect for edit.

My objective is to create 1000 pages based on @unicode-org/unilex's 1000's files.

Current code


// edit page: method 2
(async () => {
    await wiki.login('Dragons Bot', 'pass', 'https://commons.wikimedia.org/api.php');
    const wiki = new Wikiapi('https://www.lingualibre.org/api.php');
    await wiki.edit_page('User:Dragons_Bot', function(page_data) {
        return page_data.wikitext
            + `\nHi, I'm Dragons Bot ! I plan to upload lists and others maintenances.`;
    }, {bot: 1, nocreate: 1, minor: 1});
    console.log('Done.');
})();
hugolpz commented 3 years ago

Solution:

kanasimi commented 3 years ago

Yes, you may try https://lingualibre.org/wiki/Special:BotPasswords

hugolpz commented 3 years ago

Kanasimi thank you, Do you need new users to test around and report their experiences and needs to you ? I will explore basic stuff, but I may encourage others to test your tool as well. PS: current issue can be closed. I'am able to log some test edits : )

kanasimi commented 3 years ago

Yes, if there are comments to this library, please report them here (github). 😃