User:Fyren/revdata

The revision data that User:Fyren/editstats was generated from looks like this:

 GuildWiki http://localhost/wiki/Main_Page MediaWiki 1.7.1 first-letter Media Special Talk User User talk GuildWiki GuildWiki talk Image Image talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk Build Build talk Main Page 1 move=sysop:edit=sysop 1 2005-05-07T15:37:39Z MediaWiki default 2 2005-05-07T15:48:21Z Gravewit 1 ... more s ... ... more s ...

Edits made by an anonymous user have no  and an  instead of a, like this:

1.2.3.4</ip>

Although "MediaWiki default" counts as anonymous, as seen near the top.

All of the s and s are probably not of interest, they're just indexes for everything. Gravewit was the first user, so he's got user ID 1, the main page is the first page created in installation, so it's got page ID 1, and the first revision created was a revision for the main page, so it's got revision ID 1, and the text for that revision has text ID 1. Gravewit edited the main page, so that revision has revision and text IDs of 2 (but they won't always stay in step).

The Perl I used (not written by me) was: while (<>){if (/<(username|ip)>(.*)<.(username|ip)>/){$hash{$2}++;}} my @list = sort byedits keys our %hash; foreach $item (@list) {print "# $item $hash{$item}\n";} sub byedits {our %hash; $hash{$b} <=> $hash{$a};}

So it just counts lines with or , basically.