contributors 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/perl
  2. # Copyright (C) 2006 Alex Schroeder <alex@emacswiki.org>
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. my $FS = "\x1e";
  17. my %Total = ();
  18. my %Month = ();
  19. while (<STDIN>) {
  20. my ($ts, $pagename, $minor, $summary, $host, $username, $revision,
  21. $languages, $cluster)
  22. = split(/$FS/);
  23. my ($sec, $min, $hour, $mday, $mon, $year) = gmtime($ts);
  24. my $key = sprintf("%d-%02d", 1900 + $year, $mon + 1);
  25. # $username = 'Anon' unless $username;
  26. $Total{$key}++;
  27. $Month{$key}{$username}++ if $username;
  28. }
  29. print "Month Total Top Poster Edits\n";
  30. for my $key (sort keys %Total) {
  31. my @posters = keys %{$Month{$key}};
  32. @posters = sort { $Month{$key}{$b} <=> $Month{$key}{$a} } @posters;
  33. my $top = shift @posters;
  34. printf("%s %6d %20s %5d\n", $key, $Total{$key},
  35. $top, $Month{$key}{$top});
  36. }