Search engines to search homepages

JQ Johnson jqj at darkwing.uoregon.edu
Fri Aug 1 09:52:22 EDT 1997


Bill Drew asks about writing forms that use altavista but automatically
restrict the search to a particular site or url prefix.  Jerry Kuntz gave us a
simple example of such a form, where the query box is initialized to hold the
restriction term.  Jerry uses AV "advanced" search.  For a similar example, but
using AV "simple" search, see
<http://darkwing.uoregon.edu/~jqj/inter-pub/forms/search-example.html> (that
example uses the UO's intranet copy of altavista rather than the world-wide
database, but the syntax is identical).

I use this as one of my first examples of using forms in an introductory class
on forms and cgi scripts.  It's a nice example since it allows the patron to do
something useful with forms without having to write a cgi script.

A more complex and user-friendly approach (that hides the extra search term
from the user) is to have your form collect data and invoke your own CGI
script.  The script would then modify the user's arguments to add the
appropriate restriction term, and would redirect the browser to altavista with
the modified arguments.  That's the approach we use at UO for our library
search page.  See <http://libweb.uoregon.edu/network/libweb-search.html>.  If
anyone wants the source for the CGI script we use (Perl, running on an Apache
server), it is available at <http://libweb.uoregon.edu/~jqj/av-search.pl>.

JQ Johnson                      office: 115F Knight Library
Academic Education Coordinator  email: jqj at darkwing.uoregon.edu
1299 University of Oregon       voice: 1-541-346-1746  fax: -3485
Eugene, OR  97403-1299          <http://darkwing.uoregon.edu/~jqj>



More information about the Web4lib mailing list