Index: harvest/ChangeLog
diff -c harvest/ChangeLog:2.28 harvest/ChangeLog:2.29
*** harvest/ChangeLog:2.28	Mon Sep 22 12:05:05 1997
--- harvest/ChangeLog	Wed Oct  1 16:10:02 1997
***************
*** 1,4 ****
--- 1,6 ----
  Changes in current version
+ 	- Added N-at-a-time output to the nph-search CGI, so results can
+ 	  be paged. (David Hoekman)
  	- Added noregex option to nph-search and to the broker Glimpse
  	  interface to allow the disabling of regular expressions in 
  	  search patterns (Simon Wilkinson)
Index: harvest/components/broker/standard/WWW/nph-search.in
diff -c harvest/components/broker/standard/WWW/nph-search.in:2.4 harvest/components/broker/standard/WWW/nph-search.in:2.6
*** harvest/components/broker/standard/WWW/nph-search.in:2.4	Fri Sep 19 11:19:48 1997
--- harvest/components/broker/standard/WWW/nph-search.in	Fri Oct  3 11:08:42 1997
***************
*** 8,20 ****
  #  $BQLOG = "/usr/local/etc/httpd/logs/BrokerQuery.log";
  $BQLOG = "/dev/null";
  
! $rcsid = 'nph-search.in,v 2.4 1997/09/19 15:19:48 sxw Exp';
  #######################################################################
  #
  #  nph-search - Customizable WWW Interface to the Harvest Broker
  #
  #  Usage: Called as a CGI proccess from httpd
! #  
  #############################################################################
  #
  #  Harvest Indexer http://www.tardis.ed.ac.uk/harvest/
--- 8,20 ----
  #  $BQLOG = "/usr/local/etc/httpd/logs/BrokerQuery.log";
  $BQLOG = "/dev/null";
  
! $rcsid = 'nph-search.in,v 2.6 1997/10/03 15:08:42 sxw Exp';
  #######################################################################
  #
  #  nph-search - Customizable WWW Interface to the Harvest Broker
  #
  #  Usage: Called as a CGI proccess from httpd
! #
  #############################################################################
  #
  #  Harvest Indexer http://www.tardis.ed.ac.uk/harvest/
***************
*** 24,30 ****
  #  the Harvest Project. Development is carried out by numerous individuals
  #  in the Internet community, and is not officially connected with the
  #  original Harvest Project or its funding sources.
! # 
  #  Please mail harvest@tardis.ed.ac.uk if you are interested in participating
  #  in the development effort.
  #
--- 24,30 ----
  #  the Harvest Project. Development is carried out by numerous individuals
  #  in the Internet community, and is not officially connected with the
  #  original Harvest Project or its funding sources.
! #
  #  Please mail harvest@tardis.ed.ac.uk if you are interested in participating
  #  in the development effort.
  #
***************
*** 32,51 ****
  #  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., 675 Mass Ave, Cambridge, MA 02139, USA.
! # 
  
  # If name is nph-search, then we behave as an nph- cgi (ie send more headers,
  # and use unbuffered output)
! # (behave as BrokerQuery.pl.cgi used to if not nph-search)  
  
  $nph = $0 =~ /nph-/;
  
--- 32,51 ----
  #  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., 675 Mass Ave, Cambridge, MA 02139, USA.
! #
  
  # If name is nph-search, then we behave as an nph- cgi (ie send more headers,
  # and use unbuffered output)
! # (behave as BrokerQuery.pl.cgi used to if not nph-search)
  
  $nph = $0 =~ /nph-/;
  
***************
*** 83,92 ****
  
  # Send the MIME header *now* if we're in debug mode this means it will always
  # be text/html, but means when can see debugging information from parse_config
! 						     
  &send_header() if $debug;
  
! # Read in the 'master config' file.  
  &parse_config ("$DIR/lib/BrokerQuery.cf");
  &parse_defaults;
  
--- 83,92 ----
  
  # Send the MIME header *now* if we're in debug mode this means it will always
  # be text/html, but means when can see debugging information from parse_config
! 
  &send_header() if $debug;
  
! # Read in the 'master config' file.
  &parse_config ("$DIR/lib/BrokerQuery.cf");
  &parse_defaults;
  
***************
*** 130,137 ****
  $maxresult	= &option('maxresultflag');
  $maxfiles	= &option('maxobjflag');
  $maxlines	= &option('maxlineflag');
  $errors		= &option('errorflag');
! $broker 	= &option('broker') || 
  		  &option('host');
  $verbflag	= &option('verbose')    	eq "" ? 0 : 1;
  $version	= &option('version')		eq "" ? 0 : 1;
--- 130,138 ----
  $maxresult	= &option('maxresultflag');
  $maxfiles	= &option('maxobjflag');
  $maxlines	= &option('maxlineflag');
+ $perpage 	= &option('perpageflag');
  $errors		= &option('errorflag');
! $broker 	= &option('broker') ||
  		  &option('host');
  $verbflag	= &option('verbose')    	eq "" ? 0 : 1;
  $version	= &option('version')		eq "" ? 0 : 1;
***************
*** 196,202 ****
  	@X = split (/\s+/, $userquery);
  	for ($i=0; $i<=$#X; $i++) {
  	    $X[$i] = "\"$X[$i]\"" if ($X[$i] =~ /\W/);
! 	    $X[$i] = "(keywords:$X[$i] OR title:$X[$i] OR body:$X[$i] OR headings:$X[$i] OR address:$X[$i])"
          }
          $userquery = join (' AND ', @X);
      }
--- 197,204 ----
  	@X = split (/\s+/, $userquery);
  	for ($i=0; $i<=$#X; $i++) {
  	    $X[$i] = "\"$X[$i]\"" if ($X[$i] =~ /\W/);
! 	    $X[$i] = "(keywords:$X[$i] OR title:$X[$i] OR body:$X[$i] OR
! headings:$X[$i] OR address:$X[$i])"
          }
          $userquery = join (' AND ', @X);
      }
***************
*** 236,241 ****
--- 238,245 ----
  #
  $html_query = &html_escape ($query);
  print &expand ($CFG{'ResultHeader'});
+ push @first_page, &expand ($CFG{'ResultHeader'}) if $perpage && !
+ $current_page;
  $connected = 0;
  
  while ($#hostport > $[) {
***************
*** 262,273 ****
  
  sub send_header {
      local($content)="text/html";
!     
      $content= &expand($CFG{'ContentType'}) if defined $CFG{'ContentType'};
  
      if ($nph) {
! 	$|=1; 
! 	
  	print "HTTP/1.0 200 OK\n";
  	print "Server: $ENV{SERVER_SOFTWARE}\n";
  	print "Content-Type: ", &expand ($CFG{'ContentType'}), "\r\n\r\n";
--- 266,277 ----
  
  sub send_header {
      local($content)="text/html";
! 
      $content= &expand($CFG{'ContentType'}) if defined $CFG{'ContentType'};
  
      if ($nph) {
! 	$|=1;
! 
  	print "HTTP/1.0 200 OK\n";
  	print "Server: $ENV{SERVER_SOFTWARE}\n";
  	print "Content-Type: ", &expand ($CFG{'ContentType'}), "\r\n\r\n";
***************
*** 331,336 ****
--- 335,342 ----
  
          $/="\n";
          print &expand ($CFG{'ResultSetBegin'});
+         @first_page = &expand ($CFG{'ResultSetBegin'})
+             if $perpage && ! $current_page;
          if (!defined $sort) {
              while (<$S>) {
                  chop $_;
***************
*** 342,348 ****
                  if (/^126 -/o || /^120 -/o || /^103 -/o || /^111 -/o) {
                      $new_line= $_;
                      $curobj= $OBJ;
!                     while (($curobj) && (($_, $curobj) = split(/\n/, $curobj, 2))) {
  
                          # 124 - The description line of the match
                          if (/^124 - (\d+)/o) {
--- 348,355 ----
                  if (/^126 -/o || /^120 -/o || /^103 -/o || /^111 -/o) {
                      $new_line= $_;
                      $curobj= $OBJ;
!                     while (($curobj) && (($_, $curobj) = split(/\n/,
! $curobj, 2))) {
  
                          # 124 - The description line of the match
                          if (/^124 - (\d+)/o) {
***************
*** 358,364 ****
                              $att    = $1;
                              $n      = $2;
                              next if ($n == 0);
!                             $SOIF{$att} = &html_escape (substr($curobj, 0, $n));
                              $curobj = substr($curobj, $n);  # delete the data
                              next;
                          }
--- 365,372 ----
                              $att    = $1;
                              $n      = $2;
                              next if ($n == 0);
!                             $SOIF{$att} = &html_escape (substr($curobj, 0,
! $n));
                              $curobj = substr($curobj, $n);  # delete the data
                              next;
                          }
***************
*** 413,419 ****
                              $cs_f = $cs_url if ($cs_url =~ /\/$/o);
                              next;
                          }
!                         
                          # Broker homepage URL
                          if (/^126 - (.*)$/o) {
                              $hp_url = $1;
--- 421,427 ----
                              $cs_f = $cs_url if ($cs_url =~ /\/$/o);
                              next;
                          }
! 
                          # Broker homepage URL
                          if (/^126 - (.*)$/o) {
                              $hp_url = $1;
***************
*** 428,440 ****
                              foreach $k (sort keys %SOIF) {
                                  $att = $k;
                                  $val = $SOIF{$k};
!                                 $attributes .= &expand($CFG{'FormatAttribute'});
                              }
                              print &expand ($CFG{'PrintObject'});
                              $opaque     = "";
                              $url        = "";
                              $cs_url     = "";
                              $desc       = "";
                              next;
                          }
  
--- 436,455 ----
                              foreach $k (sort keys %SOIF) {
                                  $att = $k;
                                  $val = $SOIF{$k};
!                                 $attributes .=
! &expand($CFG{'FormatAttribute'});
                              }
                              print &expand ($CFG{'PrintObject'});
+                             push(@first_page,&expand ($CFG{'PrintObject'}))
+                                 if $perpage && ! $current_page;
+                             &N_at_a_time(1) if $perpage &&
+                                 0==$nobjects%$perpage && $nobjects>0;
+ 
                              $opaque     = "";
                              $url        = "";
                              $cs_url     = "";
                              $desc       = "";
+ 			    %SOIF	= ();
                              next;
                          }
  
***************
*** 450,455 ****
--- 465,472 ----
                           || ($new_line =~ /^111 - (.*)$/o))) {
                          $curobj="$new_line\n";
                          print &expand ($CFG{'ResultSetEnd'});
+                         push @first_page, &expand ($CFG{'ResultSetEnd'})
+                             if $perpage && ! $current_page;
                          $msg = $1;
                          if ($msg =~ /PARSE ERROR/o) {
                              print &expand ($CFG{'ParseError'});
***************
*** 471,476 ****
--- 488,494 ----
                      $OBJ .= $_ . "\n";
                  }
              }
+             &N_at_a_time(0) if $perpage;
          } else {
              while (<$S>) {
                  chop $_;
***************
*** 495,501 ****
  
  	    &rank_objects(@OBJ,@RANK) if ($sort eq 'by-rank');
  
!             while (($curobj || (undef %SOIF,$curobj = shift(@OBJ))) && (($_, $curobj) = split(/\n/, $curobj, 2))) {
  
                  # 124 - The description line of the match
                  if (/^124 - (\d+)/o) {
--- 513,520 ----
  
  	    &rank_objects(@OBJ,@RANK) if ($sort eq 'by-rank');
  
!             while (($curobj || (undef %SOIF,$curobj = shift(@OBJ))) &&
! (($_, $curobj) = split(/\n/, $curobj, 2))) {
  
                  # 124 - The description line of the match
                  if (/^124 - (\d+)/o) {
***************
*** 536,541 ****
--- 555,562 ----
                  # 111 - Error Message that ends Broker Results
                  if (/^103 - (.*)$/o || /^111 - (.*)$/o) {
                      print &expand ($CFG{'ResultSetEnd'});
+                     push @first_page, &expand ($CFG{'ResultSetEnd'})
+                         if $perpage && ! $current_page;
                      $msg = $1;
                      if ($msg =~ /PARSE ERROR/o) {
                          print &expand ($CFG{'ParseError'});
***************
*** 606,615 ****
--- 627,642 ----
                          $attributes .= &expand($CFG{'FormatAttribute'});
                      }
                      print &expand ($CFG{'PrintObject'});
+                     push @first_page, &expand ($CFG{'PrintObject'})
+                       if $perpage && ! $current_page;
+                     &N_at_a_time(1)
+                       if $perpage && 0==$nobjects%$perpage && $nobjects>0;
+ 
                      $opaque     = "";
                      $url        = "";
                      $cs_url     = "";
                      $desc       = "";
+ 		    %SOIF	= ();
                      next;
                  }
  
***************
*** 618,623 ****
--- 645,651 ----
                      next;
                  }
  	    }
+         &N_at_a_time(0) if $perpage;
  	}
  }
  
***************
*** 645,657 ****
  
  # Gross regexp's to do some ifdef-type substitutions
  #
! # Use: 
  #       <?foo>abcxyz</?foo>     becomes       abcxyz
  #       <?>abcxyz</?>           is deleted
  #
  # so the user can conditionally include a section of text by
  # enclosing it in <?$var>...</?$var>.  The section will be
! # included if $var is not the null string.  If a newline 
  # follows </?> the newline is removed.
  #
  ### # NOTE: this is still buggy.
--- 673,685 ----
  
  # Gross regexp's to do some ifdef-type substitutions
  #
! # Use:
  #       <?foo>abcxyz</?foo>     becomes       abcxyz
  #       <?>abcxyz</?>           is deleted
  #
  # so the user can conditionally include a section of text by
  # enclosing it in <?$var>...</?$var>.  The section will be
! # included if $var is not the null string.  If a newline
  # follows </?> the newline is removed.
  #
  ### # NOTE: this is still buggy.
***************
*** 675,685 ****
  	    $begin=index($_,'<?>');      # Find it's location.
  	    unless ($begin == -1) {      # As long as we did find it....
  	             # Find it's paired </?>
! 	        $end=index($_,'</?>',$begin)+4; 
  	             # Include the following \n too, if there...
  	        if (substr($_,$end,1) eq "\n") { ++$end; }
  	             # Now delete the whole "<?> ... </?>"
! 	        substr($_,$begin,$end-$begin) = "";   
  	    }
  	}
  	# Now just delete _all_ tags of the form <?x>, </?x>
--- 703,713 ----
  	    $begin=index($_,'<?>');      # Find it's location.
  	    unless ($begin == -1) {      # As long as we did find it....
  	             # Find it's paired </?>
! 	        $end=index($_,'</?>',$begin)+4;
  	             # Include the following \n too, if there...
  	        if (substr($_,$end,1) eq "\n") { ++$end; }
  	             # Now delete the whole "<?> ... </?>"
! 	        substr($_,$begin,$end-$begin) = "";
  	    }
  	}
  	# Now just delete _all_ tags of the form <?x>, </?x>
***************
*** 737,749 ****
  	close CF;
  	1;
  }
! 	
  sub client_socket {
  	local ($host, $port) = @_;
  	local ($sockaddr) = 'S n a4 x8';
  	local ($name, $aliases, $proto) = getprotobyname('tcp');
  	local ($connected) = 0;
! 	
  	# Lookup addresses for remote hostname
  	#
  	local($w,$x,$y,$z,@thataddrs) = gethostbyname($host);
--- 765,777 ----
  	close CF;
  	1;
  }
! 
  sub client_socket {
  	local ($host, $port) = @_;
  	local ($sockaddr) = 'S n a4 x8';
  	local ($name, $aliases, $proto) = getprotobyname('tcp');
  	local ($connected) = 0;
! 
  	# Lookup addresses for remote hostname
  	#
  	local($w,$x,$y,$z,@thataddrs) = gethostbyname($host);
***************
*** 862,868 ****
  # $msg = $rqpairs{'message'};
  # $date = &get_date;
  # chop($thishost = `hostname`);
! # 
  # # Check for blank title and URL
  # #
  # &failure ("Blank title")     	if ($title eq "");
--- 890,896 ----
  # $msg = $rqpairs{'message'};
  # $date = &get_date;
  # chop($thishost = `hostname`);
! #
  # # Check for blank title and URL
  # #
  # &failure ("Blank title")     	if ($title eq "");
***************
*** 885,891 ****
  # Author:
  # 	James Tappin: sjt@xun8.sr.bham.ac.uk
  #	School of Physics & Space Research University of Birmingham
! #	Feb 1993.		
  
  # Copyright & Disclaimer.
  #	This set of routines may be freely distributed, modified and
--- 913,919 ----
  # Author:
  # 	James Tappin: sjt@xun8.sr.bham.ac.uk
  #	School of Physics & Space Research University of Birmingham
! #	Feb 1993.
  
  # Copyright & Disclaimer.
  #	This set of routines may be freely distributed, modified and
***************
*** 939,945 ****
  }
  
  sub url_decode {
! #	Decode a URL encoded string or array of strings 
  #		+ -> space
  #		%xx -> character xx
  
--- 967,973 ----
  }
  
  sub url_decode {
! #	Decode a URL encoded string or array of strings
  #		+ -> space
  #		%xx -> character xx
  
***************
*** 954,967 ****
      # comes back as
      #    $RQ{'foo'} eq 'abc xyz'
      # Otherwise, the previous method just gave us one or the other.    -DW
!     # 
      local ($k, $v);
      local (%Y);
      while (($k=shift @_) ne '' && ($#_ >= 0)) {
  	$v=shift @_;
  	$Y{$k} = defined $Y{$k} ? join (' ', $Y{$k}, $v) : $v;
      }
!     %Y; 
  }
  
  # sort the objects by number of matched lines
--- 982,995 ----
      # comes back as
      #    $RQ{'foo'} eq 'abc xyz'
      # Otherwise, the previous method just gave us one or the other.    -DW
!     #
      local ($k, $v);
      local (%Y);
      while (($k=shift @_) ne '' && ($#_ >= 0)) {
  	$v=shift @_;
  	$Y{$k} = defined $Y{$k} ? join (' ', $Y{$k}, $v) : $v;
      }
!     %Y;
  }
  
  # sort the objects by number of matched lines
***************
*** 996,1003 ****
  	$objnum++;
      }
  #   pop off the "126" and "103" results (I hope they're at the end!)
! #    pop(@object_index);
! #    pop(@object_index);
      @sorted_index= sort byrate @object_index;
      $objnum=0;
      foreach $index (@sorted_index) {
--- 1024,1031 ----
  	$objnum++;
      }
  #   pop off the "126" and "103" results (I hope they're at the end!)
!     pop(@object_index);
!     pop(@object_index);
      @sorted_index= sort byrate @object_index;
      $objnum=0;
      foreach $index (@sorted_index) {
***************
*** 1013,1019 ****
  
  # translate SGML entities
  # produced from
! # perl -ne 'if (/^ *<.ENTITY *([\S]*) *CDATA *"&#([\d]+);".*>/) { if ($2 < 0x100) {printf "s/&$1;/\\x%x/g;\n", $2;} else {printf "s/&$1;/\\\\#$2/g;\n";}}'
  
  sub entities {
      $_ = $_[0];
--- 1041,1049 ----
  
  # translate SGML entities
  # produced from
! # perl -ne 'if (/^ *<.ENTITY *([\S]*) *CDATA *"&#([\d]+);".*>/) { if ($2 <
! 0x100) {printf "s/&$1;/\\x%x/g;\n", $2;} else {printf
! "s/&$1;/\\\\#$2/g;\n";}}'
  
  sub entities {
      $_ = $_[0];
***************
*** 1275,1281 ****
  s/&lsaquo;/\\#8249/g;
  s/&rsaquo;/\\#8250/g;
  
!     
      return($_);
  }
  
--- 1305,1411 ----
  s/&lsaquo;/\\#8249/g;
  s/&rsaquo;/\\#8250/g;
  
! 
      return($_);
  }
  
+ sub N_at_a_time {
+ # David Hoekman  Oct 1, 1997
+ #    Split search results into segments, 'n' results at a time.  The value of
+ # 'n' is set by the $perpage variable, which is defined via the 'perpageflag'
+ # query option.  Each segment is written to a separate temporary file; the
+ # location of these files must be configured locally.  This routine also
+ # removes old temporary files, when they are older than a certain age.
+ #
+ #    This routine is not called, nor is the @first_page variable created, if
+ # $perpage is not defined, so there should be no side-effects/surprises if
+ # the calling FORM doesn't set 'perpageflag'
+ #
+ # The following variables should be configured locally:
+ #
+ # $expire
+ # Temporary files are deleted after this many hours.  Or, more precisely, when
+ # this program is run, files older than $expire hours are deleted.
+ #
+ # $tmp_dir
+ # This is the location where temporary files are kept. This directory needs a
+ # permissive access mode, 'chmod 777', so that the 'nobody' user (or whatever
+ # user httpd uses) can write and delete files there.  It is a fatal error if
+ # this directory does not exist, or cannot be written in.
+ #
+ # $tmp_www
+ # This prefaces the URL file reference that leads to the 'Next' and 'Previous'
+ # pages of results, e.g.:
+ #     http://www.some.host/tmp/875722836-6913-2.html
+ #
+ # Typically, $tmp_www will be a symbolic link, at the WWW document root, that
+ # points to $tmp_dir.
+ 
+ 	###### configure these locally! #######
+ 	my $expire  = 3;	# expiration interval, in hours
+ 	my $tmp_dir = "$ENV{HARVEST_HOME}/tmp";	# dir for temp files;
+ 'chmod 777'!
+ 	my $tmp_www = "tmp";					# URL path
+ pointing to $tmp_dir
+ 	######    end configuration     #######
+ 
+ 	local($more) = @_;
+ 	my($previous_page, $next_page);
+ 	my $tmp_prefix = "$^T-${$}";	# prefix for temporary files
+ 
+ 	# if this is the last page of results, remove old temporary files
+ 	# (if $expire=3, then 3/24 sets a 3 hour expiration cycle)
+ 	unless ($more) {
+ 		chdir "$tmp_dir";
+ 		foreach $file (<[89]*-[0-9]*-[1-9]*\.html>) {
+ 			unlink "$file" if -M $file > $expire/24;
+ 		}
+ 	}
+ 
+ 	# write stored 'first' page (duplicates data sent to STDOUT/browser)
+ 	if (! $current_page) {
+ 		$current_page = 1;
+ 		open(TEMP,">$tmp_dir/$tmp_prefix-1.html") ||
+ 			&fatal("<b>Error: cannot write temporary files at
+ '$tmp_dir'!</b>");
+         print TEMP "<html>\n";
+ 		print TEMP &expand ($CFG{'ResultHeader'});
+ 		print TEMP @first_page;
+         print TEMP &expand ($CFG{'ResultSetEnd'});
+ 		print TEMP "<p>\n<center>";
+ 		print TEMP qq{[<a
+ href="/$tmp_www/$tmp_prefix-2.html">Next</a>]};
+ 	    print TEMP qq{[<a href="$hp_url">New Search</a>]} if $hp_url ne
+ 'UNKNOWN';
+ 		print TEMP "<p>\n</center>";
+ 		print TEMP "</body></html>\n";
+ 		undef @first_page;
+ 	}
+ 
+ 	# finish off current page
+     print &expand ($CFG{'ResultSetEnd'}) if $more;
+ 	$previous_page = $current_page - 1; $next_page = $current_page + 1;
+ 	print "<p>\n<center>";
+ 	print qq{[<a
+ href="/$tmp_www/$tmp_prefix-$previous_page.html">Previous</a>]}
+ 		if $previous_page > 0;
+ 	print qq{[<a
+ href="/$tmp_www/$tmp_prefix-$next_page.html">Next</a>]} if $more;
+ 	print qq{[<a href="$hp_url">New Search</a>]} if $hp_url ne 'UNKNOWN';
+ 	print "</center>\n";
+ 	return unless $more; # stop here if no more results!
+ 	print "</body>\n</html>\n";
+ 
+ 	# increment page counter, open next results page
+ 	$current_page++;
+ 	close(TEMP);
+ 	open(TEMP,">$tmp_dir/$tmp_prefix-$current_page.html") ||
+ 		&fatal("<b>Error: cannot write temporary files at
+ '$tmp_dir'!</b>");
+ 	select(TEMP);
+ 
+ 	# print beginning of next page
+ 	print "<html>\n";
+ 	print &expand ($CFG{'ResultHeader'});
+     print &expand ($CFG{'ResultSetBegin'});
+ }
Index: harvest/components/gatherer/standard/summarizers/HTML.sum
diff -c harvest/components/gatherer/standard/summarizers/HTML.sum:2.0 harvest/components/gatherer/standard/summarizers/HTML.sum:2.1
*** harvest/components/gatherer/standard/summarizers/HTML.sum:2.0	Sun Mar 16 17:08:18 1997
--- harvest/components/gatherer/standard/summarizers/HTML.sum	Thu Sep 25 10:00:36 1997
***************
*** 1,84 ****
  #!/bin/sh
  #
! #  HTML.sum - Uses the SGML summarizer to summarizer HTML
  #
- #  HTML.sum,v 1.5 1996/01/16 08:44:28 duane Exp
  #
! ######################################################################
! #  Copyright (c) 1994, 1995.  All rights reserved.
! #  
! #    The Harvest software was developed by the Internet Research Task
! #    Force Research Group on Resource Discovery (IRTF-RD):
! #  
! #          Mic Bowman of Transarc Corporation.
! #          Peter Danzig of the University of Southern California.
! #          Darren R. Hardy of the University of Colorado at Boulder.
! #          Udi Manber of the University of Arizona.
! #          Michael F. Schwartz of the University of Colorado at Boulder.
! #          Duane Wessels of the University of Colorado at Boulder.
! #  
! #    This copyright notice applies to software in the Harvest
! #    ``src/'' directory only.  Users should consult the individual
! #    copyright notices in the ``components/'' subdirectories for
! #    copyright information about other software bundled with the
! #    Harvest source code distribution.
! #  
! #  TERMS OF USE
! #    
! #    The Harvest software may be used and re-distributed without
! #    charge, provided that the software origin and research team are
! #    cited in any use of the system.  Most commonly this is
! #    accomplished by including a link to the Harvest Home Page
! #    (http://harvest.cs.colorado.edu/) from the query page of any
! #    Broker you deploy, as well as in the query result pages.  These
! #    links are generated automatically by the standard Broker
! #    software distribution.
! #    
! #    The Harvest software is provided ``as is'', without express or
! #    implied warranty, and with no support nor obligation to assist
! #    in its use, correction, modification or enhancement.  We assume
! #    no liability with respect to the infringement of copyrights,
! #    trade secrets, or any patents, and are not responsible for
! #    consequential damages.  Proper use of the Harvest software is
! #    entirely the responsibility of the user.
! #  
! #  DERIVATIVE WORKS
! #  
! #    Users may make derivative works from the Harvest software, subject 
! #    to the following constraints:
! #  
! #      - You must include the above copyright notice and these 
! #        accompanying paragraphs in all forms of derivative works, 
! #        and any documentation and other materials related to such 
! #        distribution and use acknowledge that the software was 
! #        developed at the above institutions.
! #  
! #      - You must notify IRTF-RD regarding your distribution of 
! #        the derivative work.
! #  
! #      - You must clearly notify users that your are distributing 
! #        a modified version and not the original Harvest software.
! #  
! #      - Any derivative product is also subject to these copyright 
! #        and use restrictions.
! #  
! #    Note that the Harvest software is NOT in the public domain.  We
! #    retain copyright, as specified above.
! #  
! #  HISTORY OF FREE SOFTWARE STATUS
! #  
! #    Originally we required sites to license the software in cases
! #    where they were going to build commercial products/services
! #    around Harvest.  In June 1995 we changed this policy.  We now
! #    allow people to use the core Harvest software (the code found in
! #    the Harvest ``src/'' directory) for free.  We made this change
! #    in the interest of encouraging the widest possible deployment of
! #    the technology.  The Harvest software is really a reference
! #    implementation of a set of protocols and formats, some of which
! #    we intend to standardize.  We encourage commercial
! #    re-implementations of code complying to this set of standards.  
! #  
! #  
  exec SGML.sum HTML $*
  
  # If you would prefer to not use the SGML summarizer, you can use 
--- 1,9 ----
  #!/bin/sh
  #
! #  HTML.sum - Uses either the lax or the SGML summarizer to summarize HTML
  #
  #
! 
  exec SGML.sum HTML $*
  
  # If you would prefer to not use the SGML summarizer, you can use 
***************
*** 86,88 ****
--- 11,19 ----
  # and uncommenting the line below.
  
  # exec HTML-lax.sum --body-text $*
+ 
+ # Alternatively, if you have perl5 and the HTMLParse module, you can try
+ # the new, perl HTML summariser by uncommenting the following line
+ 
+ # exec HTML-sum.pl
+ 
Index: harvest/components/gatherer/standard/summarizers/Makefile.in
diff -c harvest/components/gatherer/standard/summarizers/Makefile.in:2.3 harvest/components/gatherer/standard/summarizers/Makefile.in:2.4
*** harvest/components/gatherer/standard/summarizers/Makefile.in:2.3	Thu Sep 11 13:56:33 1997
--- harvest/components/gatherer/standard/summarizers/Makefile.in	Thu Sep 25 10:00:38 1997
***************
*** 1,7 ****
  #
  #  Makefile for the standard Harvest Gatherer summarizers
  #
! # Makefile.in,v 2.3 1997/09/11 17:56:33 sxw Exp
  
  prefix = @prefix@
  INSTALL_BINDIR	= $(prefix)/bin
--- 1,7 ----
  #
  #  Makefile for the standard Harvest Gatherer summarizers
  #
! # Makefile.in,v 2.4 1997/09/25 14:00:38 sxw Exp
  
  prefix = @prefix@
  INSTALL_BINDIR	= $(prefix)/bin
***************
*** 36,41 ****
--- 36,42 ----
  		  Dvi.sum \
  		  FullText.sum \
  		  HTML.sum \
+ 		  HTML-sum.pl \
  		  Mail.sum \
  		  ManPage.sum \
  		  NewsArticle.sum \
