User:Flcelloguy/Tool
From Wikipedia, the free encyclopedia
It has been suggested that this page or section be merged with User:Titoxd/Flcelloguy's Tool. (Discuss) |
After Kate's Tool suffered more technical issues (relating to server and disk failures), I decided to create a backup to the now famous tool. Instead of relying on SQL queries or anything dependent on the server, however, Flcelloguy's Tool is extremely crude and rudimentary. In fact, the basic algorithm is simply copying and pasting one's contributions and parsing through them. This is not intended to compete with Kate's Tool but merely be a back-up; in fact, Kate's Tool is (by far) superior to this crude code. In addition, there are many limitations to the code I have developed.
Contents |
[edit] Warning
As I have stated above, this is not supposed to compete with Kate's Tool, but merely serve as a backup. In no way am I promoting editcountitis; instead, I merely offer another tool for when Kate's Tool is down.
[edit] Requirements
You must have a Java IDE and JDK (freeware available; see below). Thus, you must make two downloads - one from Sun Microsystems, which developed Java, and another from a Java run-time developement program. I recommend JCreator and BlueJ.
[edit] Links
[edit] Capabilities
[edit] Current Capabilities
- Count the number of edits
- Break down count by project namespace
- Count percentage and number of "minor" flag usage
[edit] Future developments
- Merge the two pages (this page and User:Titoxd/Flcelloguy's Tool), perhaps under a WP:TOOLS subfile; rename to reflect that it's not "my" tool, but both my and Titoxd's tool
- Test and release Titoxd's contributions, which parses from the source code, instead of copying and pasting contributions
- Add more buttons to that, make more user friendly
- Add more detailed statistics with the parsing of timestamps, etc. available in Titoxd's code
- Better and more detailed instructions on how to download and use (perhaps a JAR?)
- Output to
txt
file for debugging (already done) and also to make copying results to the project easier - Add "First edit" date
- Count percentage of edit summary usage
- Attempt to make counting less crude by using a query
[edit] Known bugs
- Right now, any edits to the article "Wikipedia" will fall under the Project talk namespace. I'll work this out later. (Any edits to the articles "Project", "Image", or any of the namespaces that have articles will also be placed in the wrong section.)
- Category talk has not been implemented for some unknown reason; right now, the edits are counted as mainspace edits.
[edit] Versions
- Version 1.0 — count edits
- Version 2.0 (current) — count edits, breakdown by namespace, count and percent of minor edits
- Versions 3.0 and updates — GUI and more user friendly; parses from HTML file of contributions source code and can merge several files
[edit] Instructions
After you have downloaded all the appropriate files, copy and paste the code below into a file named Stats.java
. Copy and paste the person's contributions into a text file called Input.txt
. For people with over 5000 edits, you will need to copy and paste more than once. The txt file should look something like this (the numbers should be asterisks after you copy and paste the contributions):
- 15:37, November 12, 2005 (hist) (diff) User talk:Ral315 (→Drudge page - Newsroom) (top) [rollback]
- 15:36, November 12, 2005 (hist) (diff) Wikipedia:Wikipedia Signpost/Newsroom/Other (→Next issue (November 14) - I'll do CheckUser, can someone else do the Jaraxle story?) (top) [rollback]
- 15:24, November 12, 2005 (hist) (diff) User talk:Jnothman (→Re: Links - Thanks!) (top) [rollback]
- 15:21, November 12, 2005 (hist) (diff) User:Flcelloguy/monobook.js (Add stuff) (top) [rollback]
- 15:13, November 12, 2005 (hist) (diff) User talk:Jnothman (→Re: Links - Thnaks, review?)
- 15:11, November 12, 2005 (hist) (diff) User:Flcelloguy/monobook.js (Add LI link)
- 15:06, November 12, 2005 (hist) (diff) User:Flcelloguy/monobook.js (Adding links)
- 15:01, November 12, 2005 (hist) (diff) User talk:Jnothman (→Re: Links - Thnaks!)
- 14:56, November 12, 2005 (hist) (diff) User talk:Jnothman (→Re: Links - D'oh!)
- 14:53, November 12, 2005 (hist) (diff) User talk:Jnothman (→Re: Links - Thnaks!)
- 14:46, November 12, 2005 (hist) (diff) Talk:Main Page (→Today's featured article - Fixed)
- 14:41, November 12, 2005 (hist) (diff) User:Flcelloguy/Sandbox (Testing...) (top) [rollback]
- 14:36, November 12, 2005 (hist) (diff) User:Flcelloguy/monobook.js (Remove newly added stuff; seems to be hindering the popups and other monobook functions)
- 14:30, November 12, 2005 (hist) (diff) Wikipedia talk:Esperanza (→John Kerry - Reply) (top) [rollback]
- 14:26, November 12, 2005 (hist) (diff) Wikipedia talk:Requests for adminship (→RFBs - My 2 cents)
- 14:24, November 12, 2005 (hist) (diff) Wikipedia:Requests for bureaucratship/Jtkiefer (→Jtkiefer - Re: TIme?)
- 14:09, November 12, 2005 (hist) (diff) User talk:Jnothman (→Re: Links - P.S Can't get it to work...)
- 14:07, November 12, 2005 (hist) (diff) User:Flcelloguy/monobook.js (Not working...)
- 14:06, November 12, 2005 (hist) (diff) User:Flcelloguy/monobook.js (Add to monobook)
- 14:03, November 12, 2005 (hist) (diff) User talk:Jnothman (Thanks!)
- 01:55, November 12, 2005 (hist) (diff) Wikipedia talk:Arbitration Committee Elections December 2005/Straw poll (See Mobocracy)
- 01:48, November 12, 2005 (hist) (diff) User:Flcelloguy (Add link to meta page) (top) [rollback]
- 01:42, November 12, 2005 (hist) (diff) User talk:202.177.148.100 ({{test3}}) (top) [rollback]
- 01:41, November 12, 2005 (hist) (diff) m Glen Jacobs (Reverted edits by 202.177.148.100 to last version by 12.191.214.243)
- 01:39, November 12, 2005 (hist) (diff) Wikipedia:Miscellaneous deletion/Wikipedia:Personal attack intervention noticeboard (Response)
- 00:46, November 12, 2005 (hist) (diff) m Lopez (Reverted edits by Flcelloguy to last version by Canderson7) (top) [rollback]
- 00:46, November 12, 2005 (hist) (diff) m Lopez (Reverted edits by Canderson7 to last version by 202.75.205.59)
After you save the file, compile your program and then execute. It will tell you how many edits are there (in this case, 27).
[edit] The code (Version 2.0)
/*Author: Flcelloguy *Program: Flcelloguy's Tool (Stats.java) *Version 2.0; released December 07 2005 *Capabilities: Count edits, break down by namespace, count minor edits and calculate percentage *Please leave this block in. *Code from http://en.wikipedia.org/wiki/User:Flcelloguy/Tool * [[User:Flcelloguy/Tool]] * Permission is granted to distribute freely, provided attribution is granted. * Note: To copy and paste, please click edit first and then highlight all, and then copy. I'm having some formatting issues in the "view" mode. Thanks! */ import javax.swing.JOptionPane; import java.io.BufferedReader; import java.io.FileReader; import java.util.StringTokenizer; import java.io.*; import java.util.*; //import java.util.FileReader; public class Stats { private static int numEdits = 0; private static int minorEdits = 0; private static int User = 0; private static int Category = 0; private static int Image_talk= 0; private static int Imagew = 0; private static int MediaWiki_talk = 0; private static int MediaWiki = 0; private static int Talk = 0; private static int Template_talk = 0; private static int Template = 0; private static int User_talk = 0; private static int Wikipedia_talk = 0; private static int Wikipedia = 0; private static int Mainspace = 0; public static void main (String args[]) throws IOException { JOptionPane.showMessageDialog(null, "Flcelloguy's Tool \n Designed by Flcelloguy \n Statistics for editcounters", "Welcome!", JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(null, "Current status: \n Editcount only \n Coming soon: \n Breakdown by namespace" + "\n User friendly version \n Edit summary usage \n Minor edits usage \n First edit date", "Information", JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(null, "Number of edits: " + editcount(), "Results", JOptionPane.INFORMATION_MESSAGE); } public static int editcount() throws IOException { FileReader reader = new FileReader("Input.txt"); BufferedReader in = new BufferedReader(reader); String inputline = ""; StringTokenizer token; System.out.println("Computing..."); while (inputline != null) { inputline = in.readLine(); if (inputline !=null) token = new StringTokenizer(inputline); else break; for (int i = 1; i<8; i++) { token.nextToken(); } String input = token.nextToken(); //System.out.println(input); if (input.equals("m")) { minorEdits++; input = token.nextToken(); } if (input.equals("Wikipedia")) Wikipedia_talk++; else if (input.equalsIgnoreCase("User")) User_talk++; else if (input.equals("Template")) Template_talk++; else if (input.equals("MediaWiki")) MediaWiki_talk++; else if (input.equals("Image")) Image_talk++; else if (input.length()>5 && input.substring(0,5).equals("User:")) User++; else if (input.length()>5 && input.substring(0,5).equals("Talk:")) Talk++; else if (input.length()>6 && input.substring(0,6).equals("Image:")) Imagew++; else if (input.length()>9 && input.substring(0,9).equals("Category:")) Category++; else if (input.length()>9 && input.substring(0,9).equals("Template:")) Template++; else if (input.length()>10 && input.substring(0,10).equals("MediaWiki:")) MediaWiki++; else if (input.length()>10 && input.substring(0,10).equals("Wikipedia:")) Wikipedia++; else { Mainspace++; //System.out.println("Mainspace added: " + input); } numEdits++; } //Prints out statistics System.out.println("-------------------"); System.out.println("Breakdown by namespace:"); System.out.println("User: " + User); System.out.println("User talk: " + User_talk); System.out.println("Category: " + Category); System.out.println("Image: " + Imagew); System.out.println("Image talk: " + Image_talk); System.out.println("MediaWiki: " + MediaWiki); System.out.println("MediaWiki talk: " + MediaWiki_talk); System.out.println("Template: " + Template); System.out.println("Template talk: " + Template_talk); System.out.println("Project: " + Wikipedia); System.out.println("Project talk: " + Wikipedia_talk); System.out.println("Main (articles): " + Mainspace); System.out.println("Article talk: " + Talk); System.out.println("-------------------"); System.out.println("Overall statistics: "); System.out.println("Total edits: " + numEdits); System.out.println("Minor edits: " + minorEdits); System.out.println("Percentage of minor edits: " + (int)(((double)minorEdits)/numEdits * 100.0) + "% *"); System.out.println("* - percentage is always rounded down to nearest whole number percentage."); System.out.println("Percent edit summary: Not available yet."); System.out.println("-------------------"); return numEdits; } }
[edit] Requests, comments
If you don't feel like downloading all this, Flcelloguy will do edit counts on request when Kate's Tool is down. Simply notify him. Please also direct all questions, comments, and concerns to him. Thanks!
[edit] Special thanks
Special thanks to Titoxd for helping me design this; he has been a great help and has already written a lot of code (specifically, breaking up the code into classes, methods, and parsing the source code, which will all be released in 3.0). Thanks a lot!
[edit] See also
- Wikipedia:Kate's Tool
- Interiot's Tool, an alternative hosted on the internet that counts edits and provides breakdown by namespace