#!/usr/bin/perl # editable-search.cgi - Example of ODP:: (Version 0.01) # Copyright (C)2002 Richard P. Fuller # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use CGI qw(:standard); use ODP::Search; if (!param('search')) { &form; } else { print header(); print start_html('Editable Search Results'); my $search = new ODP::Search(param('search')); print $search->resultcount." results found."; my $results = $search->resultcount; if ($results > 30) { $results = 30; } print "

Here, have the first $results."; print "

    "; for ($n=1; $n<=$results; $n++) { my $result = $search->result($n); print '
  1. [EDIT] '."{'url'}\">$result->{'title'} - $result->{'desc'}
  2. "; } print "
"; print '
'; print end_html; } exit; sub form() { print header().< Editable Search
Search term:
END_FORM }