kanasimi / wikiapi

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

Upload to commons #18

Closed hugolpz closed 3 years ago

hugolpz commented 3 years ago

Hello, I see on the readme the following :

// upload file / media
(async () => {
    const wiki = new Wikiapi;
    await wiki.login('user', 'password', 'test');
    let result = await wiki.upload({ file_path: '/local/file/path', comment: '', text: '' });
})();

Nice. It does the job. But what is the recommended approach to complete the Commons.wikimedia.org Upload Wizard's form with author, source, license, categories and co ? Should I program a second section of code which edit the page after upload. Or should I use text:"value" with "value" being my whole page's wikicode ?

Note: you can answer me here, I will PR the Readme with a clarification. 😉

Please also note you don't have test for uploads.

kanasimi commented 3 years ago

MW ban the edit from cloudflare which CI use, so I can only test the function manually.

hugolpz commented 3 years ago

I'm hacking an usecase, will test XD