/[swish]/trunk/make_config.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/make_config.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 53 by dpavlin, Tue Jan 20 18:41:38 2004 UTC revision 67 by dpavlin, Wed Mar 17 12:22:26 2004 UTC
# Line 17  my $url = shift @ARGV; Line 17  my $url = shift @ARGV;
17  my $title = join(" ",@ARGV);  my $title = join(" ",@ARGV);
18    
19  if (!$name || !$url) {  if (!$name || !$url) {
20          print "Usage: $0 [--stripurl=path] name URL title\n";          print "Usage: $0 [--stripurl=path] name URL|path title\n";
21          exit;          exit;
22  }  }
23    
# Line 37  if ($url =~ m#(http://[^/]+)(/.*)$#) { Line 37  if ($url =~ m#(http://[^/]+)(/.*)$#) {
37          } else {          } else {
38                  $stripurl = $host;                  $stripurl = $host;
39          }          }
40    } elsif (-d $url && $url =~ m#.+?(/references/)#) {
41            $stripurl = $1;
42            $host = "";
43  } else {  } else {
44          print "Can't parse URL $url into host and path!\n";          print "Can't parse URL $url into host and path!\n";
45          exit 1;          exit 1;
# Line 45  if ($url =~ m#(http://[^/]+)(/.*)$#) { Line 48  if ($url =~ m#(http://[^/]+)(/.*)$#) {
48  my $baseurl = $url;  my $baseurl = $url;
49  $baseurl =~ s#/[^/]+$#/#g;  $baseurl =~ s#/[^/]+$#/#g;
50    
51  print "Config name: $name\nCrawling url: $url [strip $stripurl]\n";  print "Config name: $name\nCrawling: $url [strip $stripurl]\n";
52  print "Title: $title\n" if ($title);  print "Title: $title\n" if ($title);
53    
54    my $indexer_config = << "EOF";
 my $config = <<"EOF";  
   
 ###################################################  
55  IncludeConfigFile $dir/common.config  IncludeConfigFile $dir/common.config
56    
57  # this is a cludge to implement no parent URL feature in swish indexer  # this is a cludge to implement no parent URL feature in swish indexer
58  IndexDir "$baseurl $url"  IndexDir "$baseurl $url"
59  ReplaceRules replace "$baseurl " ""  ReplaceRules replace "$baseurl " ""
60  ReplaceRules replace "${stripurl}" ""  ReplaceRules replace "${stripurl}" ""
61    EOF
62    
63    $indexer_config = << "EOF" if (-d $url);
64    IncludeConfigFile $dir/common-progspider.config
65    IndexDir $dir/spider/progspider
66    SwishProgParameters $url
67    ReplaceRules replace "/rest/references/" "/"
68    EOF
69    
70    my $config = <<"EOF";
71    
72    ###################################################
73    $indexer_config
74  IndexFile $dir/index/$name  IndexFile $dir/index/$name
75    
76  StoreDescription HTML <body> 500  StoreDescription HTML <body> 500
# Line 73  EOF Line 85  EOF
85    
86  my $xml = << "EOF";  my $xml = << "EOF";
87  <config  <config
88          max_hits="1000"          max_hits="10"
89          prog="/usr/bin/swish-e"          prog="/usr/bin/swish-e"
90          index="$dir/index/$name"          index="$dir/index/$name"
91          charset="iso-8859-2"          charset="iso-8859-2"
# Line 97  $xml .= << "EOF"; Line 109  $xml .= << "EOF";
109          >          >
110          <labels>          <labels>
111                  <label value="10"> 10</label>                  <label value="10"> 10</label>
112                    <label value="50"> 100</label>
113                  <label value="100"> 100</label>                  <label value="100"> 100</label>
                 <label value="0">unlimited</label>  
114          </labels>          </labels>
115          <text>          <text>
116                  <search>Search for </search>                  <search>Search for </search>

Legend:
Removed from v.53  
changed lines
  Added in v.67

  ViewVC Help
Powered by ViewVC 1.1.26