Jump to content

Wikipedia talk:Wikipedians by number of edits/scripts

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Original Perl Script

[edit]

Here's the perl script used to generate the list, in case anybody else wants to update it. (It's ugly and hackish, forgive me.):

# Save the results of the following queries to 'curs' and 'olds' respectively:
#  SELECT count(*),cur_user_text FROM cur GROUP BY cur_user_text LIMIT <some big number>
#  SELECT count(*),old_user_text FROM old GROUP BY old_user_text LIMIT <some big number>

%equivs = (
 "KoyaanisQatsi" => "Koyaanis Qatsi",
    "Koyaanisqatsi" => "Koyaanis Qatsi",
    "Koyaansqatsi2350" => "Koyaanis Qatsi",
    "Larry_Sanger" => "Larry Sanger",
    "LarrySanger" => "Larry Sanger",
    "LeeDanielCrocker" => "Lee Daniel Crocker",
    "Magnus" => "Magnus Manske",
    "ManningBartlett" => "Manning Bartlett",
    "Perry\@bebbington.org" => "Perry Bebbington",
    "Ray G. Van De Walker" => "Ray Van De Walker",
    "Simon_J_Kissane" => "Simon J Kissane",
    "CareyEvans" => "Cary Evans",
    "Chris_mahan" => "Chris mahan",
    "ChuckSmith" => "Chuck Smith",
    "Dave_McKee" => "Dave McKee",
    "David_spector" => "David Spector",
    "DickBeldin" => "Dick Beldin",
    "F. Lee Horn" => "F. Lee Horn",
    "GregLindahl" => "Greg Lindahl",
    "Greg_Lindahl" => "Greg Lindahl",
    "66.47.62.78" => "H.J.",
    "66.47.62.xxx" => "H.J.",
    "J. Jonat" => "H.J.",
    "HannesHirzel" => "Hannes Hirzel",
    "JimboWales" => "Jimbo Wales",
    "62.253.64.7" => "TwoOneTwo",
    "62.253.64.xxx" => "TwoOneTwo",
    "Tzartzam" => "Sam Francis",
    "Tokerboy" => "TUF-KAT",
    "Tucci528" => "TUF-KAT"
    "Anonymous56789" => "LittleDan",
#   "BigFatBuddha" => "º¡º", (I'm not sure if this line is messing things up)
    "Vera Cruz" => "Lir",
    "Susan Mason" => "Lir",
    "Dietary Fiber" => "Lir",
    "Shino Baku" => "Lir",
    "Like a Virgin" => "Lir",
    "Ril" => "Lir",
    "Zxcvb" => "Lir",
    "Pizza Puzzle" => "Lir"
    "Peter Chamberlain" => "Lir"
    "Terry Gander" => "Lir"
);

open CUR, "<curs";
while ($x = <CUR>) {
 chomp $x;
 $x =~ /^([0-9]+) ([\x20-\xff]+[\S])[\x01-\x20]*$/;
 if($equivs{$2}) { $u = $equivs{$2}; } else { $u=$2; }
 $count{$u} = $1;
}


print qq(<table border="1">\n);

open OLD, "<olds";
while ($x = <OLD>) {
    chomp $x;
 $x =~ /^(\d+) ([\x20-\xff]+[\S])[\x1-\x20]*$/;
    if($equivs{$2}) { $u = $equivs{$2}; } else { $u=$2; }
 if($count{$u}) {
   $count{$u} += $1;
 } else {
   $count{$u} = $1;
 }
}

@count2 = map { { ($_ => $count{$_}) } } 
              sort { $count{$b} <=> $count{$a}
                     or $b cmp $a
                   } keys %count;

$maxcount = 200;

foreach $x (@count2) {
    $n++;
    ($u, $c) = each %$x;
    print qq(<tr><td align="right">$n<td>$u<td align="right">$c\n);
    last if ($n >= $maxcount);
}

print qq(</table>\n);

New SQL and Perl Script

[edit]

SQL Query

[edit]

drop table if exists tester; create table tester (select count(*) AS counter, cur_user_text AS user from cur GROUP BY cur_user_text) union all (select count(*) AS counter, old_user_text AS user from old GROUP BY old_user_text) ORDER BY counter;

drop table if exists tester2; create table tester2 SELECT counter, IF( user = "Pizza Puzzle", "Lir", IF(user = "Terry Gander", "Lir", IF( user = "Peter Chamberlain", "Lir", IF( user = "Koyaanisqatsi", "Koyaanis Qatsi", IF( user = "KoyaanisQatsi", "Koyaanis Qatsi", IF( user = "Koyaansqatsi2350", "Koyaanis Qatsi", IF( user = "Zxcvb", "Lir", IF( user = "Ril", "Lir", IF( user = "Like a Virgin", "Lir", IF( user = "Shino Baku", "Lir", IF( user = "Dietary Fiber", "Lir", IF( user = "Susan Mason", "Lir", IF( user = "Vera Cruz", "Lir", IF( user = "Anonymous56789", "LittleDan", IF( user = "Tokerboy", "TUF-KAT", IF( user = "Tucci528", "TUF-KAT", IF( user = "Tzartzam", "Sam Francis", IF( user = "62.253.64.xxx", "TwoOneTwo", IF( user = "62.253.64.7", "TwoOneTwo", IF( user = "JimboWales", "Jimbo Wales", IF( user = "66.47.62.xxx", "H.J.", IF( user = "66.47.62.78", "H.J.", IF( user = "Greg_Lindahl", "Greg Lindahl", IF( user = "GregLindahl", "Greg Lindahl", IF( user = "J. Jonat", "H.J.", IF( user = "HannesHirzel", "Hannes Hirzel", IF( user = "F. Lee Horn", "F. Lee Horn", IF( user = "DickBeldin", "Dick Beldin", IF( user = "David_spector", "David Spector", IF( user = "Dave_McKee", "Dave McKee", IF( user = "ChuckSmith", "Chuck Smith", IF( user = "Chris_mahan", "Chris mahan", IF( user = "CareyEvans", "Cary Evans", IF( user = "Simon_J_Kissane", "Simon J Kissane", IF( user = "Ray G. Van De Walker", "Ray Van De Walker", IF( user = "Perry@bebbington.org", "Perry Bebbington", IF( user = "ManningBartlett", "Manning Bartlett", IF( user = "Magnus", "Magnus Manske", IF( user = "LeeDanielCrocker", "Lee Daniel Crocker", IF( user = "LarrySanger", "Larry Sanger", IF( user = "Larry_Sanger", "Larry Sanger", IF( TRIM(user) REGEXP "^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9x]{1,3}$", "Anonymous IP", user )))))))))))))))))))))))))))))))))))))))) AS user FROM tester;

SELECT * from tester2 into outfile 'users.txt';

Perl Script

[edit]
# Zero out each user's count

open CUR, "<users.txt"; while ($x = <CUR>) {

chomp $x;
$x =~ /^(\d+)\s+([\x20-\xff]+[\S])+$/;
$count{$2} = 0;

}

# Count the user's edits

open CUR, "<users.txt"; while ($x = <CUR>) {

chomp $x;
$x =~ /^(\d+)\s+([\x20-\xff]+[\S])+$/;
$count{$2} += $1;

}

# Generate the HTML

print qq(<table border="1">\n); @count2 = map { { ($_ => $count{$_}) } }

             sort { $count{$b} <=> $count{$a}
                    or $b cmp $a
                  } keys %count;

$maxcount = 200; foreach $x (@count2) {

   $n++;
   ($u, $c) = each %$x;
   print qq(<tr><td align="right">$n<td>[[User:$u|]]<td align="right">$c\n);
   last if ($n >= $maxcount);

} print qq(</table>\n);