User:Remsense/zh.js

const p = mw.util.addPortlet( 'p-zh', '中文', '#p-tb' ); mw.util.addPortletLink( 'p-zh', '#', '赞' ); // move portlet to end of list. if ( p ) { p.parentNode.appendChild(p); }

/*

var url = "https://en.wikipedia.org/w/api.php";

var params = { action: "query", format: "json", list: "usercontribs", ucuser: "Remsense", ucnamespace: 0, uclimit: 200 };

url = url + "?origin=*"; Object.keys(params).forEach(function(key){url += "&" + key + "=" + params[key];});

fetch(url) .then(function(response){return response.json;}) .then(function(response) {       var usercontrib = response.query.usercontribs;        for (var uc in usercontrib) {            console.log(usercontrib[uc].title);        }    }) .catch(function(error){console.log(error);});