User:Void/findInactiveSysops.js: Difference between revisions

m
Per removal. Consul action
(attach the window to the page body to prevent unintended issues)
m (Per removal. Consul action)
 
(16 intermediate revisions by 3 users not shown)
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 124 ⟶ 125:
function filterUsers ( userlist ) {
var userstring = userlist.toString();
var exempt = ["John", "Void", "NDKilla", "Reception123", "Revi", "Southparkfan", "Abuse filter", "Void-bot", "VoidwalkerZppix", "PaladoxRhinosF1", "ZppixMediaWiki message delivery", "MirahezeBotsMediaWiki default", "RhinosF1Babel AutoCreate", "MediaWikiDmehus", message"Revibot", delivery"Delete page script", "ZIMove Jonypage script", "BonnedavFlow talk page manager", "BabelUniversal AutoCreateOmega", "HeartsDo", "MacFan4000"];
 
for ( i = 0; i < exempt.length; i++ ) {
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 176:
 
checked++;
progressBar.setProgress( parseInt(checked (checked/ total) * 100 ) );
 
if( checkedcheckList.length ==> total0 ) {
checkUser( checkList.pop() );
} else {
listInactiveUsers();
}
Line 217 ⟶ 219:
if( dataType === "logs" ) {
date = data.slice( 0, data.indexOf('T') );
date = date.replace( "/-"/g, "" );
} else if( dataType === "tribs" ) {
date = data.slice( data.indexOf('|') + 1, data.indexOf('T') );
date = date.replace( "/-"/g, "" );
}