--- trunk/make_config.pl 2003/04/30 12:40:09 32 +++ trunk/make_config.pl 2003/08/04 16:41:14 44 @@ -7,10 +7,14 @@ use strict; -my ($name,$url,$stripurl) = @ARGV; +my $name = shift @ARGV; +my $url = shift @ARGV; +#my $stripurl = shift @ARGV; +my $stripurl; +my $title = join(" ",@ARGV); if (!$name || !$url) { - print "Usage: $0 name URL\n"; + print "Usage: $0 name URL [strip from url] [optional title]\n"; exit; } @@ -23,7 +27,7 @@ my ($host,$urlpath); -if ($url =~ m#(http://[^/]+)(/.+)$#) { +if ($url =~ m#(http://[^/]+)(/.*)$#) { ($host,$urlpath) = ($1,$2); if ($stripurl && $urlpath =~ m/^(.*$stripurl)/) { $stripurl = $1; @@ -39,6 +43,7 @@ $baseurl =~ s#/[^/]+$#/#g; print "Config name: $name\nCrawling url: $url [strip $stripurl]\n"; +print "Title: $title\n" if ($title); my $config = <<"EOF"; @@ -47,8 +52,8 @@ IncludeConfigFile $dir/common.config # this is a cludge to implement no parent URL feature in swish indexer -IndexDir "$url $baseurl" -ReplaceRules replace " $baseurl" "" +IndexDir "$baseurl $url" +ReplaceRules replace "$baseurl " "" ReplaceRules replace "${host}${stripurl}" "" IndexFile $dir/index/$name @@ -69,9 +74,15 @@ prog="/usr/bin/swish-e" index="$dir/index/$name" charset="iso-8859-2" - title="$name search" affix="/usr/lib/ispell/american.aff" - url="$stripurl" +EOF +if ($title) { + $xml .= "\ttitle=\"$title\"\n"; +} else { + $xml .= "\ttitle=\"$name search\"\n"; +} +$xml .= "\turl=\"$stripurl\"\n" if ($stripurl); +$xml .= << "EOF"; > @@ -86,7 +97,15 @@ don't display results details Showing %s documents (of maximum %d)... (%s) Can't find any documents (%s, %s) - + swishdescription swishdocsize