User:Sander Säde/editcount.js

addOnloadHook(doQuickCount);

function doQuickCount { if (mw.config.get('wgPageName') == "Special:Contributions") { var name = document.getElementById("contentSub").getElementsByTagName("a"); var rname = name[0].innerHTML; if (rname == "talk") return; //IP var cnteraj = sajax_init_object(null); cnteraj.open("GET", "http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=" + rname + "&usprop=editcount&format=json", true); cnteraj.onreadystatechange = function {     if(cnteraj.readyState != 4) return; var response = eval('(' + cnteraj.responseText + ')'); var count = response["query"]["users"][0]["editcount"]; document.getElementById("contentSub").innerHTML = document.getElementById("contentSub").innerHTML + " · Edit count: " + count + " "; };   cnteraj.send(null); } }