Closed hugolpz closed 2 years ago
Wish you a happy new year holiday 😸
Try forcing update of cejs via node GitHub.updater.node.js
. See https://github.com/kanasimi/CeJS/issues/13
Hi. For https://github.com/hugolpz/WikiapiJS-Eggs/blob/main/wiki-download_by_root_category-many.js You may try this:
// PURPOSE: Script to upload targets using an external data file.
// Run: $node wiki-upload-many.js
const fs = require('fs');
const Wikiapi= require('wikiapi');
const logins = require('./logins.js');
(async () => {
// Connect
var targetwiki = new Wikiapi;
// Login credentials from .login*.js
await targetwiki.login({user_name:logins.commons.user_name, password:logins.commons.pass, API_URL:logins.commons.api});
console.log(`User ${logins.commons.user_name.split('@')[0]} is connected !`);
/* *************************************************************** */
/* CORE ACTION(S) HERE : HACK ME ! ******************************* */
// Settings
var localDirectory = './downloads/',
masterCategory = 'Lingua_Libre_pronunciation';
await targetwiki.download(targetwiki.to_namespace(masterCategory, 'Category'), { directory: localDirectory });
/* END CORE ****************************************************** */
/* *************************************************************** */
})();
You may also change the format in logins.js
so you can use await targetwiki.login(logins.commons);
Thanks ! Issue was fixed by your code and me updating the package.
Given the code :
Update cejs done:
Due to
.category_tree()
, the script prints the following warning message, while the script continue to work fine :