User:Mosrod/editcounter

Description

 * This script counts your contributions and breaks them down by namespace, then writes a table with the information to a page in your userspace. You need JavaScript enabled in your browser in order to use this script and you must be a part of the autoconfirmed user group in order to use the script for the first time with no problems. If not, you need to manually create the page where your edit count will be and then run the script.


 * The script can take a while to run (several minutes if your edits are in the thousands), so be patient. If your browser tells you it's taking too long, you can allow it to continue and it will eventually finish. If it takes longer than 5 minutes, then you should start to worry, unless you have 40,000+ edits.

Set up

 * The code in the dotted box below must be copied exactly how it is, without changing my username, into either your common JavaScript page at common.js or your vector skin page at vector.js. You can use other .js pages for other skins, but I cannot guarantee it will work on all skins. As long as the skin has a "User contributions" link somewhere, it should work. If you want to use this script on another wiki, you must use your .js page at that wiki.


 * All you need to run the script is what is in the dotted box below. The script will run based upon who is logged in at your computer, not where the script is at. My username is there because the script is in my userspace, so if you change it the script won't load unless you have your own copy. This script should work on all MediaWiki installations using version 1.18 and above. Go to the "Special:Version" page on your site to see your site's version.


 * Note: Copying the entire main script to your own space is not required, even if you are not on Wikipedia. If you want to make your own changes to the script, as I did using the original author's version, then you can copy the script and do what you want with it, as long as what I have at the top of the script is not removed.

/* Counts all your edits and saves them to a page ( http://en.wikipedia.org/wiki/User:Mosrod/editcounter ) */ if (mw.config.get('wgTitle') === mw.config.get('wgUserName') && mw.config.get('wgNamespaceNumber') === 2) { /* begin options */

/* end options */ mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Mosrod/editcounter.js&action=raw&ctype=text/javascript'); }


 * The following is some options you can place in between the "options" lines in the code above. These change how the script acts and how the resulting table is displayed. Place your option customization in between the single quotes, and you MUST place a backslash (\) before any apostrophes you intend to use, for example: . If the option uses true or false, single quotes are not required.
 * The defaults are how the script runs if you don't use that option. If you like the default, you don't have to put the option in. One option per line and you can remove the begin/end option lines, they're just there to keep the option thing simple.


 * Below this table is an example table layout showing where the variables go.

Example table layout
 namespace   namespace etc.    (if tableHeaders=false:   namespace   namespace etc.)   numbers 

Usage

 * When you visit your userpage, you will see an extra link under Tools, right after the "User contributions" link. It will be labeled "Edit counter v#" where the # indicates the current script version. Just click the button and the script will execute. While it is working, the button will change to "Processing…" and when it is done it will either say "Success!" or "Error!". From there you can go look at the table in your userspace, or load/refresh the page you have it transcluded into.


 * The table is by itself on a separate page so that you can easily transclude it wherever you want. You can do so by using  to print out the whole table. The date you last ran the script and your total count are posted in subpages of the main edit count table so you can transclude those separately, as noted on the option table above.


 * Important notes :


 * If you believe the most recent version of the script was not loaded, follow the directions at the top of your common.js page while on your user page. This will force your browser to reload the page from the Internet.


 * Those "var options" are not active until you run the script again. When finding the right options, it is highly suggested to edit the page where the table is at, using the Show preview button. Once a desired format is achieved, copy the appropriate settings into the appropriate variable and test the script to see if it will make that table each time. Please do not edit your common.js page for each var change and run the script.


 * It is recommended to run the script no more than once a week, preferably once a month. Running this script often, or several people running it often, clogs up the recent changes, is an unnecessary server burden, and is generally frowned upon.
 * When  is set to , this script creates/edits three pages at a time, so please use it sparingly to avoid recent changes spam.