User:Void/findInactiveSysops.js: Difference between revisions

throttling to prevent rate limiting
(use regex instead to actually replace all instances)
(throttling to prevent rate limiting)
Line 2:
//<nowiki>
//This script automates the process of finding inactive sysops.
//Warning: the script will replace the contents of the page you are currently viewing when you click the link at the top right of the page.
//Output is in the format of "[[User:Example|Example]] || [[Special:PermanentLink/1234|timestamp]] || [[Special:Log/Example|timestamp]]"
mw.loader.using(['oojs-ui', 'mediawiki.util']).done( function () {
Line 93 ⟶ 92:
var checked = 0;
var inactive = [];
var checkList = [];
var total = 0;
 
// Get user list
Line 130 ⟶ 131:
}
 
var reducedListcheckList = userstring.split( "," );
for ( xtotal = 0; x < reducedListcheckList.length; x++ ) {
checkUser( reducedList[x], reducedListcheckList.lengthpop() );
}
}
 
function checkUser( user, total ) {
$.getJSON(
mw.util.wikiScript( 'api' ),
Line 178:
progressBar.setProgress( parseInt(checked / total) * 100 );
 
if( checkedcheckList.length ==> total0 ) {
checkUser( checkList.pop() );
} else {
listInactiveUsers();
}