Year of the Dragon: Through April 23rd, claim the adventure pack Slice of Life for free! Speak to Xatheral in the Hall of Heroes.
Game mechanics • Newbie guide • In development • DDO Store • Social Media
Challenges • Classes • Collectables • Crafting • Enhancements • Epic Destinies • Favor • Feats
Glossary • Items • Maps • Monsters • Places • Quests • Races • Reincarnation • Skills • Spells
Please create an account or log in to build a reputation and unlock more editing privileges, and then visit DDO wiki's IRC Chat/Discord if you need any help!
MediaWiki:Gadget-SpecialPages.js/ActiveUsers.js
Jump to navigation
Jump to search
Note: After saving, you may have to bypass your browser's cache to see the changes, you can click here or try one of the methods below..
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl+F5 or Ctrl+r (⌘ Command+r on a Mac)
- Google Chrome: Press Ctrl+⇧ Shift+R (⌘ Command+⇧ Shift+R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl+F5
- Konqueror: Click Reload or press F5
- Opera: Clear the cache in Tools ‣ Preferences
//<nowiki>
( function ( $, mw ) {
// Reload the page to get all users on one page
/* API query == https://ddowiki.com/api.php?action=query&format=jsonfm&aulimit=max&list=allusers&auprop=editcount|registration&auactiveusers=1 */
var activeUsers = [];
$( '#mw-content-text' ).find( 'ul li').each( function( i ) {
activeUsers[ i ] = [];
activeUsers[ i ][ 0 ] = $( this ).find( 'a:first' ).text();/* */console.info( activeUsers[ i ][ 0 ] );
activeUsers[ i ][ 1 ] = $( this ).text().match( /([\d]*?) (action|edit)s? in the last / );/* */console.info( activeUsers[ i ][ 1 ] );
activeUsers[ i ][ 1 ] = parseInt( activeUsers[ i ][ 1 ][ 1 ].toString(), 10 );/* */console.info( activeUsers[ i ][ 1 ] );
activeUsers[ i ][ 2 ] = $( this ).html();/* */console.info( activeUsers[ i ][ 2 ] );
// console.log( 'i: %d', i );
} );
activeUsers.sort( function( a, b ) {
if ( a[ 1 ] == b[ 1 ]) { return 0; }
if ( a[ 1 ] > b[ 1 ]) { return 1; }
else { return -1; }
} ).reverse();
for ( i=0; i < activeUsers.length; i++ ) {
console.info( 'User %d with %s edits: %s', i, activeUsers[ i ][ 1 ], activeUsers[ i ][ 0 ]/*, activeUsers[i][2]*/ );
}
// $( 'div#mw-content-text' ).html();
} )( mediaWiki, jQuery );
//</nowiki>[[Category:Gadgets]]