User:The Voidwalker/rfaStatsUpdater.js: Difference between revisions

Content deleted Content added
clean common sig stuff out of close
geeze, I really should try to finish this
 
Line 44:
//Get date and close. Differs for successful and unsuccessful RFAs
var date;
var successful;
var closer = null; //damn rfarow
if ( wikitext.indexOf("Closed as successful by") > 0 ) {
date = wikitext.slice( wikitext.indexOf(" at "), wikitext.indexOf(" (UTC)"));
successful = true;
if( typeof close === 'undefined' )
close = 'S';
Line 51 ⟶ 54:
else {
date = wikitext.slice( wikitext.indexOf( ", ", votePSN ), wikitext.indexOf( " (UTC)", votePSN ) );
successful = false;
//Get close
if( typeof close === 'undefined' ) {
Line 65 ⟶ 69:
}
var record = "{{Recent RfX|A|" + username + "|" + rfaTotal + "|" + date + "|" + supports + "|" + opposes + "|" + neutrals + "|" + close + "}}";
var rfarow = "{{rfarow|" + username + "|" + rfaTotal + "|" + date + "|" + close + "|" + supports + "|" + opposes + "|" + neutrals + "|" + closer + "}}";
rfaRecent( record );
//Should be good for the new methods. Make sure to test.
incRfaYear( successful );
yearRfas( record );
/*if( successful ) {
srfas( rfarow );
incUAC();
}
else {
UAC( rfarow );
incSRFA();
}*/
} catch ( e ) {
console.log( "Content request error: " + e.message );
Line 135 ⟶ 150:
console.log( "While getting the wikitext, there was an AJAX error." );
} );
}
 
function incRfaYear( successful ) {
//Incriment Wikipedia:Requests for adminship by year based on param successful
}
 
function yearRfas( record ) {
//Update Wikipedia:2017 requests for adminship
//Build in to replace 2017 with variable for current year
}