PerlでHyperEstraierの検索結果を表示する
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
[[Perl]]
&kensaku("札幌",20);
sub kensaku()
{
my($kensaku_word,$threshold) = @_;
print "$kensaku_word\n";
$pwd = '/home/****';
@res = `estcmd search -max -1 $pwd "$kensaku_word"`;
my $i;
$i=0;
foreach (@res){
if(/^\d+$/){
@lines = `estcmd get $pwd $_ `;
foreach $line (@lines){
if($line =~ /^\@uri=(.*)$/){
$file = $1;
$file =~ s/^file:\/\///;
print "file $file\n";
open(IN,$file);
while(<IN>){
chomp;
if(/$kensaku_word.*\s(\d+)$/){
$tmp_num = $1;
if($tmp_num>=$threshold){
print "$_ \n";
}
}
}
close(IN);
}
}
}
}
}
終了行:
[[Perl]]
&kensaku("札幌",20);
sub kensaku()
{
my($kensaku_word,$threshold) = @_;
print "$kensaku_word\n";
$pwd = '/home/****';
@res = `estcmd search -max -1 $pwd "$kensaku_word"`;
my $i;
$i=0;
foreach (@res){
if(/^\d+$/){
@lines = `estcmd get $pwd $_ `;
foreach $line (@lines){
if($line =~ /^\@uri=(.*)$/){
$file = $1;
$file =~ s/^file:\/\///;
print "file $file\n";
open(IN,$file);
while(<IN>){
chomp;
if(/$kensaku_word.*\s(\d+)$/){
$tmp_num = $1;
if($tmp_num>=$threshold){
print "$_ \n";
}
}
}
close(IN);
}
}
}
}
}
ページ名: