Merge commit 'origin/master'
[libwww-perl-eserte.git] / t / misc / dbmrobot
blobc1794c4b56f6576c79c0ab505148c721646c2690
1 #!/local/perl/bin/perl -w
3 use URI::URL;
4 $url = url(shift) || die "Usage: $0 <url>\n";
6 require WWW::RobotRules::AnyDBM_File;
7 require LWP::RobotUA;
9 $botname = "Spider/0.1";
11 $rules = new WWW::RobotRules::AnyDBM_File $botname, 'robotdb';
12 $ua = new LWP::RobotUA $botname, 'gisle@aas.no', $rules;
13 $ua->delay(0.1);
15 my $req = new HTTP::Request GET => $url;
17 my $res = $ua->request($req);
18 print "Got ", $res->code, " ", $res->message, "(", $res->content_type, ")\n";
20 my $netloc = $url->netloc;
21 print "This was visit no ", $ua->no_visits($netloc), " to $netloc\n";