User:Void/findInactiveSysops.js: Difference between revisions

m
Per removal. Consul action
(apparently you can wind up with no log information)
m (Per removal. Consul action)
 
(18 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 88 ⟶ 87:
 
windowManager.addWindows([ inactiveUsersProc ]);
$('#bodyContentbody').append(windowManager.$element);
windowManager.openWindow(inactiveUsersProc);
 
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 153:
}
).done( function ( data ) {
//try {
var tribsData = data.query.usercontribs;
var logsData = data.query.logevents;
Line 176:
 
checked++;
progressBar.setProgress( parseInt(checked (checked/ total) * 100 ) );
 
if( checkedcheckList.length ==> total0 ) {
checkUser( checkList.pop() );
} else {
listInactiveUsers();
}
//} catch ( e ) {
// console.log( "Content request error: " + e.message );
// console.log( "Content request response: " + JSON.stringify( data ) );
//}
} );
}
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, "" );
}