#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
while (<>) {
next if (/^\s*$/);
print;
chomp;
s/([^0-9A-Za-z_])/'%'.unpack('H2',$1)/ge;
my $url = "http://search.yahooapis.jp/WebSearchService/V1/".
"webSearch?appid=YahooDemo&query=url:$_";
if (get_num($url)) {
print "yes\n";
} else {
print "no\n";
}
}
sub get_num {
my ($url) = @_;
my $yahoo_response = get($url);
my ($num) = ($yahoo_response =~ /totalResultsAvailable="(\d)"/);
return $num;
}
% cat url-list http://nais.to/~yto/ http://nais.to/~yto/clog/2006-01-01-1.html http://www.example.com/blog/ % ./hack_url.pl url-list http://nais.to/~yto/ yes http://nais.to/~yto/clog/2006-01-01-1.html yes http://www.example.com/blog/ no
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI;
use LWP::Simple;
my $q = new CGI;
my $target = $q->param('url') || "";
print $q->header(-type => 'text/plain');
$target =~ s/([^0-9A-Za-z_])/'%'.unpack('H2',$1)/ge;
my $url = "http://search.yahooapis.jp/WebSearchService/V1/".
"webSearch?appid=YahooDemo&query=url:$target";
if (get_num($url)) {
print "document.writeln('Y!');\n";
} else {
print "document.writeln('-');\n";
}
sub get_num {
my ($url) = @_;
my $yahoo_response = get($url);
my ($num) = ($yahoo_response =~ /totalResultsAvailable="(\d)"/);
return $num;
}
<script src="hack_url.cgi?url=http://nais.to/"></script>

しかもローマ人は、思わぬ幸運に恵まれて成功するよりも、状況の厳密な
調査をしたうえでの失敗のほうを良しとする。ローマ人は、計画なしの成
功は調査の重要性を忘れさせる危険があるが、調査を完璧にした後での失
敗は、再び失敗をくり返さないための有効な訓練になると考えているので
ある。(p.43 - フラヴィウス・ヨセフ「ユダヤ戦記」からの抜粋)
人格円満な人が、大革新の推進者になる例はない。(p.165)