User:Theleekycauldron/User contributions.js

console.log("howdy!"); async function query(user,extra){ var q = await querying(user,null); var res = q.query.usercontribs; for (var i=0; i<extra; i++){ q = await querying(user,q.continue.uccontinue); console.log(q); res = q.query.usercontribs.concat(res); }   return res; } async function querying(user,start){ var url = "https://en.wikipedia.org/w/api.php"; let usercontrib; var params = { action:     "query", format:     "json", list:       "usercontribs", ucuser:     user, uclimit:    "500", ucnamespace: "3", ucprop:     "title|comment" };   if (start !== null){ params.uccontinue = start; }	url = url + "?origin=*"; Object.keys(params).forEach(function(key){url += "&" + key + "=" + params[key];});

await fetch(url).then(function(response){return response.json;}) .then(function(response) {       usercontrib = response;    }) .catch(function(error){console.log(error);}); return usercontrib; }