One of my sites was coming up with a graybar, so I wanted to check it against other hosts, besides the default. I tried a couple of the websites that I normally do this with, and they weren't working. So, I wrote the following few lines.
use strict;
use warnings;
use WWW::Google::PageRank;
my @hosts = (
"toolbarqueries.google.com",
"209.85.227.147",
"209.85.227.104",
);
for my $host (@hosts) {
print "\n$host\n";
my $pr = WWW::Google::PageRank->new(host => $host)
or die $!;
for my $domain (@ARGV) {
$domain =~ s{http://}{};
$domain =~ s{/$}{};
my $pagerank = $pr->get("http://$domain/");
print " $pagerank $domain\n";
}
}
Leave a comment