#!/asim/gnu/bin/perl # (C) Copyright 1997,98 Czo # Parts (C) A.Fenyo use CGI; $ASIM_HEADER=`/bin/cat /users/soft5/webmastr/wwwroot/ssi/asim.header/index.gb.html`; $ASIM_FOOTER=`/bin/cat /users/soft5/webmastr/wwwroot/ssi/asim.footer/index.gb.html`; $SEARCH_HEADER=`/bin/cat /users/soft5/webmastr/wwwroot/ssi/search.header-intranet/index.gb.html`; $SEARCH_MIDDLE=`/bin/cat /users/soft5/webmastr/wwwroot/ssi/search.middle-intranet/index.gb.html`; $SEARCH_FOOTER=`/bin/cat /users/soft5/webmastr/wwwroot/ssi/search.footer/index.gb.html`; print "Content-type: text/html\n\n"; $query = new CGI; $str = $query->param('searchstring'); # Czo 990607 : autorise . et _ $str =~ s/[^a-zA-Z0-9-_ \*\.]//g; $str =~ s/ -/ /g; $str =~ s/^-/ /; print "$ASIM_HEADER\n$SEARCH_HEADER\n"; print ' '; print "$SEARCH_MIDDLE\n"; #system (date); #print system ( "/usr/local/home/czo/local/FreeBSD/bin/swish-e -f /usr/local/home/czo/public_html/cgi-bin/index.swish-e -w $str" ); #$RET = `/usr/local/home/czo/local/FreeBSD/bin/swish-e -c /usr/local/home/czo/public_html/cgi-bin/index.swish-e -w $str`; #print "
";
open RESULT, "/asim/gnu/bin/swish-e -m 40 -f /users/soft5/webmastr/wwwroot/cgi-bin/intranet.dat -w $str |";


$cpt = 0;
while () {
#    chop;
#print ;

    m/err: no results/ && do
    {
      print 'No match found. ';
      print '';
     };

    m/^# Number of hits: (.*)/ && do 
    {
      print ''.$1.' matches were found. ';
      print '';
     };

    m/^#/ && next;

    
    m/^(.*) (.*) "(.*)" (.*)/ && (($res1, $res2, $res3, $res4) = ($1, $2, $3, $4)) && do
      {
         $cpt++;
         $tmp1 = $res1/10; $tmp1 =~ s/^(.*)\..*/\1/;
         $tmp = $res4/1024; $tmp =~ s/^(.*\..).*/\1/;

print '

'.$cpt.'. ['.$tmp1.'%] '.$res3.'
[URL: '.$res2.']
Page size '.$tmp.' Kb

' ; #Last modified 7-Oct-97 - # $RR =`/asim/gnu/bin/lynxx -dump $res2 | /asim/gnu/bin/grep -1 $str | /asim/gnu/bin/sed -e 's/\\($str\\)/\\\\1\\<\\/B\\>/g'`; # print "

Containing : \n$RR\n
\n" ; }; # print ''.$cpt.'- http://mpc.lip6.fr'.$file.'
'; # } # close(RESULT); print "$SEARCH_FOOTER\n$ASIM_FOOTER\n"; exit 0 __END__