Jump to content

Wikipedia:Kate's Tool

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Interiot (talk | contribs) at 14:20, 27 September 2006 (rv per talk. a decent percentage of people use Kate's). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

See also Wikipedia Tools (WP:TOOLS)

Kate's Tool is a script often used in the past to count the number of edits made by a particular Wikipedian, and which namespaces the edits fall under. It can be accessed here. This tool was written by Wikipedia user Kate, who cautions that editcountitis can be fatal. This tool no longer provides up-to-date edit counts, but others do. Essjay's PHP tool, which works right now, may be found here. Lupin's javascript may be viewed here.

Accessing Kate's Tool for any user with navigation popups

If you run the navigation popups script, then links to Kate's Tool are generated when you hover over a user link. See the screenshot for an example. Easy installation instructions are at Wikipedia:Tools/Navigation popups.

Using the javascript below, one can add a static link to Kate's Tool, located in the upper right-hand corner of the screen near the link to your userpage. The two javascripts which have been written and listed here are not comprehensive; adding this link in other skins is certainly possible.

Kate's Tool worked for all Wikimedia-run projects (such as Wiktionary, Wikisource, and the Commons). This javascript automatically brings up your editcount in the English Wikipedia; if you would rather have it bring up a count in a different Wikimedia project, change "enwiki" in line 19 (this line reads "a.href = 'http://tools.wikimedia.de/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + user;") to the short name of whichever wiki you wish to link to (i.e. "dewiki" for the German Wikipedia, "metawiki" for Meta, "commonswiki" for the Commons, etc.). You can find the name you want by using the pulldown menu on Kate's Tool which is always used to select the wiki for which editcounts are wanted.

These scripts work on any Wikimedia project.

For the monobook skin

If you use the "monobook" skin, (see your preferences), you can add this script to this location: User:USERNAME/monobook.js (where USERNAME is your username). This will create a permanent link to Kate's Tool in the top right corner of your screen.

  //  Add a "Kate" link to your monobook "personal menu" list at the very
  //  top of the page.
  //
  //  Indicate where you would like "Kate" to appear:
  //    pt-userpage, pt-mytalk, pt-preferences,
  //    pt-watchlist, pt-mycontris, pt-logout
  //
gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout"
  //
function KateLink()
{
  var user = document.getElementById( 'pt-userpage' ).firstChild.firstChild.data;

  var li = document.createElement( 'li' );
    li.id = 'pt-kate';

    var a = document.createElement( 'a' );
      a.appendChild( document.createTextNode( 'Kate' ) ); // eh, the css makes the text lowercase
      a.href = 'http://tools.wikimedia.de/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + user;

    li.appendChild( a );

  if ( ! gsKateInsertBefore ) // append to end (right) of list
  {  document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
  }
  else
  {  var before = document.getElementById( gsKateInsertBefore );
      before.appendChild( li, before );
  }
}
   if ( window.addEventListener ) window.addEventListener( 'load', KateLink, false );
else if ( window.attachEvent      ) window.attachEvent   ( 'onload', KateLink );

Alternatively, if you want the count link to enable you to check the edit count of any user you are browsing, replace the "var user = document.getElementById( 'pt-userpage' )" (line 12) line with the following:

var user = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
user = user.substring(user.indexOf('title=') + 6, user.lastIndexOf('&action=edit'));
user = user.substring(user.indexOf(':') + 1);

For the classic skin

This version is for users of the classic skin, where it can be added to User:USERNAME/standard.js. The script places a 'Kate' link immediately following your "User (Talk)" links at the top of the classic skin layout.

function KateLinkClassicSkin()
{
		//	This is tricky, as there are so few tag-IDs to assist us.
		//	I'm placing Kate right after the "User (Talk)" links at top.
		//
	var td = document.getElementById( 'topbar' ).getElementsByTagName( 'td' )[ 2 ];
	var user = td.getElementsByTagName( 'a' )[ 0 ];
	var name = user.firstChild.nodeValue;
	var loc = td.getElementsByTagName( 'br' )[ 0 ]; // insert before this

	var kate = document.createElement( 'a' );
		kate.appendChild( document.createTextNode( 'Kate' ) );
		kate.href = 'http://tools.wikimedia.de/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + name;

	td.insertBefore( document.createTextNode( ' ' ), loc );
	td.insertBefore( kate, loc );
}
if ( window.addEventListener ) window.addEventListener( 'load', KateLinkClassicSkin, false );
else if ( window.attachEvent ) window.attachEvent( 'onload', KateLinkClassicSkin );

See also