MediaWiki:Gadget-SpecialPages.js/CountEdits.js

// For Special:CountEdits // All users with an edit: http://ddowiki.com/api.php?action=query&list=allusers&format=jsonfm&auprop=groups|editcount|registration&aulimit=max&auwitheditsonly= // All contributions for a user: http://ddowiki.com/api.php?action=query&list=usercontribs&uclimit=max&ucdir=newer&continue=&format=jsonfm&ucuser= /// All users blocked by user: http://ddowiki.com/api.php?action=query&list=logevents&letype=block&lelimit=max&leprop=title&continue=&format=jsonfm&leuser= /// All pages deleted by user: http://ddowiki.com/api.php?action=query&list=logevents&letype=delete&lelimit=max&leprop=title&continue=&format=jsonfm&leuser= /// All pages moved by user: http://ddowiki.com/api.php?action=query&list=logevents&letype=move&lelimit=max&leprop=title&continue=&format=jsonfm&leuser= /// All pages protected by user: http://ddowiki.com/api.php?action=query&list=logevents&letype=protect&lelimit=max&leprop=title&continue=&format=jsonfm&leuser= //( function ( $, mw ) { // Test what page you are on  if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'CountEdits' ) {    var useLive = confirm( 'Clicking OK will redirect you to the comprehensive JavaScript version of this page' );    if ( useLive ) {      window.location = 'http://ddowiki.com/page/Special:BlankPage?withJS=MediaWiki:CountEdits.js';    }  } else if ( mw.config.get( 'wgCanonicalPagename' ) === 'Special:BlankPage' && mw.util.getParam( 'withJS' ) === 'MediaWiki:CountEdits.js' ) {    // We're on the .js version page... Get to work processing    // Get a list of users with at least one edit    var getUserContinue = '';    // while ( getUserContinue !== null ) {      new mw.Api.get( { action: 'query', list: 'allusers', auprop: 'groups|editcount|registration', aulimit: 'max', auwitheditsonly: true, aufrom: getUserContinue, continue: '' } ).done( function( gotUsers ) { for ( i = 0; i < gotUsers.query.allusers.length; i++ ) { console.log( '%d: %s', i, gotUsers.query.allusers[ i ].name ); }       if ( gotUsers.continue === undefined ) { getUserContinue = null; } else { getUserContinue = gotUsers.continue.aufrom }       console.log( 'continue is: %s', getUserContinue ); console.log( '%o', gotUsers ); } );   // }  } //} )( mediaWiki, jQuery ); //