Last active
August 20, 2016 02:48
-
-
Save cnaude/6119537 to your computer and use it in GitHub Desktop.
Parse output from http://forums.bukkit.org/members/?page=$i and sort by number of likes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
for my $i (1..16420) { | |
system("wget -O data/bf.$i.html 'http://forums.bukkit.org/members/?page=$i'"); | |
sleep 2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
use strict; | |
open (FILE, "zcat data/big.list.gz|") or die $!; | |
my %hash = {}; | |
while (<FILE>) { | |
if (/something posted by (.*?) has been 'liked'">Likes Received.*?<dd>(.*?)<\/dd>/) { | |
$hash{$1} = $2; | |
$hash{$1} =~ s/,//g; | |
} | |
} | |
close FILE; | |
sub hashValueDescendingNum { | |
$hash{$b} <=> $hash{$a}; | |
} | |
my $count = 1; | |
foreach my $key (sort hashValueDescendingNum (keys(%hash))) { | |
print "$count: $hash{$key} $key\n"; | |
$count ++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
use strict; | |
open (FILE, "zcat data/big.list.gz|") or die $!; | |
my %hash = {}; | |
while (<FILE>) { | |
if (/<dt title="Total messages posted by (.*?)">Messages:<\/dt> <dd>(.*?)<\/dd>/) { | |
$hash{$1} = $2; | |
$hash{$1} =~ s/,//g; | |
} | |
} | |
close FILE; | |
sub hashValueDescendingNum { | |
$hash{$b} <=> $hash{$a}; | |
} | |
my $count = 1; | |
foreach my $key (sort hashValueDescendingNum (keys(%hash))) { | |
print "$count: $hash{$key} $key\n"; | |
$count ++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment