#!/usr/bin/perl # # Copyright 1995 (c) Tim Laren Instant Internet Corp. # Hacker Development: Tim Laren timl@instanet.com # # WISE Search Program # # This Search functionality requires an already installed and running # Swish binary. Get swish here: http://www.eit.com/software/swish/ # require '/usr/local/etc/httpd/cgi-bin/www-lib.pl'; require '/usr/local/etc/httpd/conf/wise.conf'; # This is the swish command line for searching the index file. Leave in # the trailing -w. $swish = '/usr/local/bin/swish -f /var/httpd/wise/data/wise.swish -w'; require 'shellwords.pl'; %data = &GetArgs(); $i = 0; # get the words to search for foreach $item (%data) { if($data{$item} eq "on") { $words[$i] = $item; $i++; next; } if($data{$item} =~ /^\s*$/) { next; } $words[$i] = $data{$item}; $i++; } while($j <= $#words) { if($j == $#words) { $searchfor .= "$words[$j]"; $j++; next; } $searchfor .= "$words[$j] and "; $j++; } open(RESULT, "$swish '$searchfor'|"); &PrintFooter; dbmopen(%DBdata, "$Path/$Wise", $dbmMode); while() { next if /^#.*/; next if /^search.*/; next if /^\..*/; if(/^err.*/) { $res = "
  • No Matches Found\n"; next; } @data = &shellwords($_); $data[1] =~ s/$Path\/(\w*)/\1/; ($url, $title, $desc, $kwords) = split($split, $DBdata{$data[1]}); $title =~ s/^\s+//; $itemtime = (split('\.', $data[2]))[1]; if ($title ne "") { if ($desc ne "") { # if no short description, drop the - $res .= "
  • $title - $desc
    \n";} else { $res .= "
  • $title
    \n";}} } dbmclose(%DBdata); print &Header; print STDOUT <<"EOM"; WILMA Search Results

    Search Results



    Return to search page
    Search performed by $swishVER.
    This database maintained by $maintainer.

    EOM exit 0;