Find.pl - Site Search Script

Find.pl is a relatively simple, brute force search script used to search through files on a web site. It's a mini search engine; I use one instance of it to do all the searches under neil.verplank.org and a variety of other domains I host. It has the following groovy features:

    It can be used across multiple domains. I host a number of domains, and each domain owner can use this one script to search their particular domain.

    It can target specific directories. I have several "free standing" websites under different directories ( e.g. my furniture site, my travel site ). I use the same script to allow someone to search only that site, or to search the entire site from the root directory.

    It uses a simple template and style sheet to control the output, allowing the results to match the colors of a specific site or directory.

License

This script is both free, and open source software, licensed under the GNU / GPL license. You are free to modify it and redistribute it (as long as you include the source - see the license for details).

Requirements

   - perl 5.x (including the HTML::Template module)
   - *nix (The script uses the /usr/bin/find script. It could be modified to do a recursive "open".)
   - a web server

Installation and usage

Using the script is pretty self explanatory. Unzip the folder wherever you keep your source code. Put find.pl into your cgi-bin, set your execute permissions, then modify the clearly labeled "user variables" at the top of the script.

Put search.htm, searchResult.htm and search_style in your root web directory (typically /home/httpd/html). In any given directory, the script recursively follows all sub-directories as well. If you want to use it to target a subdirectory, you can a) put copies of search.htm and searchResults in that sub-directory, and set the hidden "directory" tag in search.htm to the targeted subdirectory you want to search, eg "/furniture" or "/travel" or "/furniture/portfolio" etc. Of course you'll probably want to change the HTML of both search.htm and the results template, searchResults.htm. Just don't delete the TMPL variables in searchResults.htm.

Download

find.tar.gz