Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Top usernames
#!/usr/bin/perl
# Scrape top usernames last week
use warnings;
use strict;
use Encode;
use URI;
use Web::Scraper;
use Data::Dumper;
my $site = "https://www.projecthoneypot.org/dictionary_attacker_usernames.php?dt=7";
my $oddnames = scraper {
process 'tr.mxro', "oddusernames[]" => scraper {
process "a", name => 'TEXT';
};
};
my $evennames = scraper {
process 'tr.mxre', "evenusernames[]" => scraper {
process "a", name => 'TEXT';
};
};
my $oddresponse = $oddnames->scrape( URI->new($site) );
my $evenresponse = $evennames->scrape( URI->new($site) );
#print Dumper($oddresponse);
#print Dumper($evenresponse);
for my $odd (@{$oddresponse->{oddusernames}}) {
print Encode::encode("utf8", "$odd->{name}\n");
}
for my $even (@{$evenresponse->{evenusernames}}) {
print Encode::encode("utf8", "$even->{name}\n");
}
#!/usr/bin/perl
# Scrape top usernames last month
use warnings;
use strict;
use Encode;
use URI;
use Web::Scraper;
use Data::Dumper;
my $site = "https://www.projecthoneypot.org/dictionary_attacker_usernames.php?dt=30";
my $oddnames = scraper {
process 'tr.mxro', "oddusernames[]" => scraper {
process "a", name => 'TEXT';
};
};
my $evennames = scraper {
process 'tr.mxre', "evenusernames[]" => scraper {
process "a", name => 'TEXT';
};
};
my $oddresponse = $oddnames->scrape( URI->new($site) );
my $evenresponse = $evennames->scrape( URI->new($site) );
#print Dumper($oddresponse);
#print Dumper($evenresponse);
for my $odd (@{$oddresponse->{oddusernames}}) {
print Encode::encode("utf8", "$odd->{name}\n");
}
for my $even (@{$evenresponse->{evenusernames}}) {
print Encode::encode("utf8", "$even->{name}\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment