--- trunk/spider/filter.pm 2004/01/23 13:10:40 56
+++ trunk/spider/filter.pm 2004/01/25 16:49:50 57
@@ -1,5 +1,8 @@
sub filter {
my $contents = shift || return;
+
+# my $verbose = 1;
+
# if you don't want content to be indexed, include it in
# foobar tags or surround it with comments
# foobar
@@ -76,14 +79,14 @@
$new_title =~ s/\s\s+/ /g;
- if ($contents =~ s,
(.*),$new_title,is) {
- print STDERR "replace title '$1' with '$new_title'\n";
- } else {
- print STDERR "adding new title '$new_title'\n";
- # try to insert after , or at top
+ if ($contents =~ s,(.*),$new_title,is) {
+ print STDERR "replace title '$1' with '$new_title'\n" if ($verbose);
+ } elsif (
+ # try to insert after , or at top
$contents =~ s,(),$1$new_title,is ||
$contents =~ s,(),$1$new_title,is ||
- $contents =~ s,^,$new_title,;
+ $contents =~ s,^,$new_title, ) {
+ print STDERR "adding new title '$new_title'\n" if ($verbose);
}
return $contents;