#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use URI;
my $target = shift @ARGV;
exit if ($target =~ /[&?%\#]/);
my $uri = URI->new($target);
my $h = $uri->host;
my $p = $uri->path;
my $url = "http://search.yahooapis.jp/WebSearchService/V1/".
"webSearch?appid=YahooDemo&query=inurl:$h$p&site=$h";
my $num = get_num($url) || 0;
print "$num\n";
sub get_num {
my ($url) = @_;
my $yahoo_response = get($url);
my ($num) = ($yahoo_response =~ /totalResultsAvailable="(\d+)"/);
return $num;
}
% ./hack_num.pl http://nais.to/~yto/ukulele 8 % ./hack_num.pl http://d.hatena.ne.jp/yto 4560
regsvr32 /u zipfldr.dll
regsvr32 /u cabview.dll
regsvr32 zipfldr.dll
regsvr32 cabview.dll


