Skip to content

Instantly share code, notes, and snippets.

@snaga
Created July 9, 2013 03:18
Show Gist options
  • Save snaga/5954426 to your computer and use it in GitHub Desktop.
Save snaga/5954426 to your computer and use it in GitHub Desktop.
rank_top_reviewers.pl
#!/usr/bin/perl
my %review;
open(F, "wget -q -O - https://commitfest.postgresql.org/action/commitfest_view/inprogress | ") || die($!);
my $count = 0;
while(<F>)
{
if ( /td/ && /colMidT/ )
{
$count++;
if ( $count==3 )
{
$name = $_;
chomp($name);
$name =~ s/.*\>(.*)\<.*/$1/;
# print $count . ": " . $name . "\n";
$name =~ s/^ *//g;
$name =~ s/ *$//g;
my @rr = split(/,/, $name);
# print "@rr\n";
foreach my $r (@rr)
{
$r =~ s/^ *//g;
$r =~ s/ *$//g;
# print "> $r\n";
if ($review{$r})
{
$review{$r} = $review{$r} + 1;
}
else
{
$review{$r} = 1;
}
}
}
}
elsif ( /\/td/ )
{
$count = 0;
}
}
close(F);
my %rank;
foreach (keys %review)
{
$rank{$review{$_}} .= $_ . ", ";
}
foreach (sort{ $b <=> $a} (keys %rank))
{
$rank{$_} =~ s/, $//;
print "$_ reviews: $rank{$_}\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment