AYUDA (fwd)

Ing. Roberto Andrade randrade@campus.iztacala.unam.mx
Tue, 15 Sep 1998 21:11:17 -0600 (CST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--=====================_905885571==_
Content-Type: TEXT/HTML; CHARSET=iso-8859-1
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-ID: <Pine.SOL.3.91.980915211016.12028C@campus>

Hola:

Les env'io este mensaje que me lleg'o a mi direcci'on personal.

Saludos,

                       Roberto Andrade Fonseca
                Universidad Nacional Autonoma de Mexico

                       Phone: 623-1154, 623-1345
               e-mail: randrade@campus.iztacala.unam.mx

---------- Forwarded message ----------
Date: Tue, 15 Sep 1998 22:52:51 +0200
From: LA =3D?iso-8859-1?Q?P=3DC1GINA?=3D DEL ROTTWEILER <info@rottweiler.dr=
ago.net>
To: randrade@campus.iztacala.unam.mx
Subject: AYUDA

HOLA 
PERDONA QUE TE MOLESTE PERO ES QUE NECESITO QUE ALGUIEN ME AYUDE PORQUE ESTOY DESESPERADO.
RESULTA QUE TENGO UN CGI PARA HACER UN BUSCADOR Y APENAS HAY QUE TOCAR NADA, UNICAMENTE LA PRIMERA FRASE, QUE EN VEZ DE PONER #!/usr/local/bin/perl HAY QUE QUITAR LA PALABRA local. QUE ES DONDE MI SERVIDOR TIENE EL INT=C9RPRETE
ESTO LO HE HECHO CON EL WORDPAD COMO ME HAN DICHO. LO HE MANDADO A MI SERVIDOR EN MODO ASCII, COMO ME HAN DICHO Y ELLOS LO HAN PUESTO EJECUTABLE Y NO SE QUE MAS. PUES RESULTA QUE NO FUNCIONA Y ME DICEN QUE EL CGI TIENE UN FALLO O NO LO MANDO BIEN POR FTP.
A MI ME CONSTA QUE NO TIENE NING=DAN FALLO PUESTO QUE NO HE TOCADO NADA Y ADEM=C1S EL AMIGO QUE ME LO HA PASADO LE FUNCIONA ESTUPENDAMENTE, LO TIENE EN
http://www.inchi.com
YO LO TENGO EN
http://www.dragonet.es/users/picolo/pruebaA.htm= POR SI QUIERES VER EL MENSAJE DE ERROR QUE SALE, Y TE MANDO TAMBI=C9N LOS ARCHIVOS POR SI QUIERES AYUDARME Y ECHARLE UN OJILLO. TE ESTAR=C9 ETERNAMENTE AGRADECIDO.
UN SALUDO Y ESPERO TU RESPUESTA.
JOSE
--=====================_905885571==_ Content-Type: TEXT/HTML; CHARSET=us-ascii Content-ID: URL Search Engines
Techno Trade Logo
                                     
URL Search Engine

Get listed towards the top of major search engines
Visit Our Sponsor


Description Feel like starting your own little yahoo ? Well, this is basically what this script does. It searches a Text database file for one or more keywords input by the user and displays all the URLs that match the Search Query. This can also be changed to search any type of text database file.
How it Works There are three main files needed for the script to run properly.
  1. urlsrch.cgi : This is the cgi script the does both searching and adding of new records so be sure to chmod it to 755 (executable).
  2. urls.txt : This is where all the data is stored and where new records are added so chmod it to 666 which gives write permissions to the file.
  3. urlsrch.html : This is the html file that functions for both searching and adding records so be sure not to change any of the FORM values in it.
Sample
urls.txt file
Page Title | What My Page is about | Keyword1 | my email | http://mypage.com
Rent-A-Car | car rental reservations | rentals | e-mail | http://www.carrental.com
Format : Title | Description | Keywords | e-mail | URL

Each line makes up one record and each record is made up of fields separated by a pipe "|" character.


Download
and
Demo




Price Free

This script can be modified for custom applications, and it doesn't just have to be URL search engine. It can also be used for searching virtually any type of text database... recipes, phone numbers, car dealers etc. The version that is available here is for a URL search engine, but if you're insterested in a custom script for your web site then E-mail me and I can quote you accordingly.



--=====================_905885571==_ Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-ID: <Pine.SOL.3.91.980915211016.12028E@campus> #!/usr/bin/perl #################################################################### # URL Search Engine # Copyright 1996 Techno Trade http://www.technotrade.com # Written By : Sammy Afifi sammy@technotrade.com # Date Last Modified : Jan 14, 1997 #################################################################### # # This script is free of charge. # Please link back to http://technotrade.com, thank you :-) ####### # # Jan 14, stops people from entering html tags, converts < to &lt; # #################################################################### # $linktitle, $linkdescrip, $linkwords, $linkemail, $linkurl # define some global variables $fields = 5; # Number of fields in each record $filename = "urls.txt"; # The database text file $results = 1000; # maximum number of results to display &parse_form; $searchstring = $FORM{'searchstring'}; &addrecord if ($searchstring eq "**ADD RECORD**"); &open_file("FILE1","",$filename); print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#0000FF VLINK=#800040 ALINK=#800040>\n"; print "<TITLE>Search Results</TITLE>\n"; print "<CENTER><BR>\n"; print "<FONT SIZE=5 COLOR=000000 FACE=\"ARIAL,TIMES NEW ROMAN\">Search Results</FONT></CENTER>\n"; print "<HR width=80% noshade><BR><UL>\n"; $counter = 0; while (($line = &read_file("FILE1")) && ($counter < $results)) { # split the fields at the | character @tabledata = split(/\s*\|\s*/,$line ,$fields); &check_record; if ($found == 1) { $counter++; &print_record; } } close(FILE1); print "</UL>\n"; if ($counter == 0) { print "<BR><B> Sorry, No Matches were found.</B>\n"; } print "<CENTER>\n"; print "<HR width=80% noshade>\n"; print "<FONT SIZE=3 COLOR=000000 FACE=\"ARIAL,TIMES NEW ROMAN\">URL Search Brought to you by : <A HREF=\"http://www.technotrade.com/cgi\">Techno Trade's CGI Archive</A></FONT></CENTER>\n"; print "</CENTER>\n"; print "</A></BODY></HTML>\n"; ######################################### # # Print the matched record # ######################################### sub print_record { print "<BR>\n"; print "<LI><A HREF=" . $linkurl . ">" . $linktitle . "</A> : $linkdescrip</B><BR>\n"; } ########################################## # # Check to see if record matches search criteria # ########################################## sub check_record { # get the data from the record read from the file. $tabledata $linktitle = $tabledata[0]; $linkdescrip = $tabledata[1]; $linkwords = $tabledata[2]; $linemail = $tabledata[3]; $linkurl = $tabledata[4]; chop($linkurl); #build the search line with all fields we want to search in $searchline = $linktitle . " " . $linkdescrip . " " . $linkwords; #search by keywords # only perform the keyword search if the length of the search string is greater than 2 # don't think we want people to search for and or or etc. $sfound = 0; $found = 0; $notfound = 1; $stlen = length($searchstring); if ($stlen > 1) { @words = split(/ +/,$searchstring); foreach $aword (@words) { if ($searchline =~ /\b$aword/i) { $sfound = 1; } else { $notfound = 0; } } } if ($sfound == 1 && $notfound == 1) { $found = 1; } # if search string is too small .. set found to 1 if ($stlen <= 1) { $found = 1; } #if page doesn't have a title then return not found $tlen = length($linktitle); if ($tlen < 1) { $found = 0; } } ############################################ # # Add Record # ############################################ sub addrecord { $linktitle = $FORM{'linktitle'}; $linkdescrip = $FORM{'linkdescrip'}; $linkwords = $FORM{'linkwords'}; $linkemail = $FORM{'linkemail'}; $linkurl = $FORM{'linkurl'}; # Convert < tags to &lt; $linktitle =~ s/</\&lt;/g; $linkdescrip =~ s/</\&lt;/g; $linkwords =~ s/</\&lt;/g; $linkemail =~ s/</\&lt;/g; $linkurl =~ s/</\&lt;/g; &open_file("FILE1",">>",$filename); &write_file("FILE1",$linktitle . "|". $linkdescrip. "|" .$linkwords ."|" .$linkemail ."|" .$linkurl ."\n"); close(FILE1); print "Content-type: text/html\n\n"; print "<html><head><title>Thank You</title></head>\n"; print "<body><BR><h3><CENTER>Thank You For Adding to this database</CENTER></h3>\n"; print "</body></html>\n"; exit; } sub parse_form { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if (length($buffer) < 5) { $buffer = $ENV{QUERY_STRING}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } } sub open_file { local ($filevar, $filemode, $filename) = @_; open ($filevar,$filemode . $filename) || die ("Can't open $filename"); } sub read_file { local ($filevar) = @_; <$filevar>; } sub write_file { local ($filevar, $line) = @_; print $filevar ($line); } --=====================_905885571==_ Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-ID: <Pine.SOL.3.91.980915211016.12028F@campus> #!/usr/bin/perl #################################################################### # URL Search Engine # Copyright 1996 Techno Trade http://www.technotrade.com # Written By : Sammy Afifi sammy@technotrade.com # Date Last Modified : Jan 14, 1997 #################################################################### # # This script is free of charge. # Please link back to http://technotrade.com, thank you :-) ####### # # Jan 14, stops people from entering html tags, converts < to &lt; # #################################################################### # $linktitle, $linkdescrip, $linkwords, $linkemail, $linkurl # define some global variables $fields = 5; # Number of fields in each record $filename = "urls.txt"; # The database text file $results = 1000; # maximum number of results to display &parse_form; $searchstring = $FORM{'searchstring'}; &addrecord if ($searchstring eq "**ADD RECORD**"); &open_file("FILE1","",$filename); print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#0000FF VLINK=#800040 ALINK=#800040>\n"; print "<TITLE>Search Results</TITLE>\n"; print "<CENTER><BR>\n"; print "<FONT SIZE=5 COLOR=000000 FACE=\"ARIAL,TIMES NEW ROMAN\">Search Results</FONT></CENTER>\n"; print "<HR width=80% noshade><BR><UL>\n"; $counter = 0; while (($line = &read_file("FILE1")) && ($counter < $results)) { # split the fields at the | character @tabledata = split(/\s*\|\s*/,$line ,$fields); &check_record; if ($found == 1) { $counter++; &print_record; } } close(FILE1); print "</UL>\n"; if ($counter == 0) { print "<BR><B> Sorry, No Matches were found.</B>\n"; } print "<CENTER>\n"; print "<HR width=80% noshade>\n"; print "<FONT SIZE=3 COLOR=000000 FACE=\"ARIAL,TIMES NEW ROMAN\">URL Search Brought to you by : <A HREF=\"http://www.technotrade.com/cgi\">Techno Trade's CGI Archive</A></FONT></CENTER>\n"; print "</CENTER>\n"; print "</A></BODY></HTML>\n"; ######################################### # # Print the matched record # ######################################### sub print_record { print "<BR>\n"; print "<LI><A HREF=" . $linkurl . ">" . $linktitle . "</A> : $linkdescrip</B><BR>\n"; } ########################################## # # Check to see if record matches search criteria # ########################################## sub check_record { # get the data from the record read from the file. $tabledata $linktitle = $tabledata[0]; $linkdescrip = $tabledata[1]; $linkwords = $tabledata[2]; $linemail = $tabledata[3]; $linkurl = $tabledata[4]; chop($linkurl); #build the search line with all fields we want to search in $searchline = $linktitle . " " . $linkdescrip . " " . $linkwords; #search by keywords # only perform the keyword search if the length of the search string is greater than 2 # don't think we want people to search for and or or etc. $sfound = 0; $found = 0; $notfound = 1; $stlen = length($searchstring); if ($stlen > 1) { @words = split(/ +/,$searchstring); foreach $aword (@words) { if ($searchline =~ /\b$aword/i) { $sfound = 1; } else { $notfound = 0; } } } if ($sfound == 1 && $notfound == 1) { $found = 1; } # if search string is too small .. set found to 1 if ($stlen <= 1) { $found = 1; } #if page doesn't have a title then return not found $tlen = length($linktitle); if ($tlen < 1) { $found = 0; } } ############################################ # # Add Record # ############################################ sub addrecord { $linktitle = $FORM{'linktitle'}; $linkdescrip = $FORM{'linkdescrip'}; $linkwords = $FORM{'linkwords'}; $linkemail = $FORM{'linkemail'}; $linkurl = $FORM{'linkurl'}; # Convert < tags to &lt; $linktitle =~ s/</\&lt;/g; $linkdescrip =~ s/</\&lt;/g; $linkwords =~ s/</\&lt;/g; $linkemail =~ s/</\&lt;/g; $linkurl =~ s/</\&lt;/g; &open_file("FILE1",">>",$filename); &write_file("FILE1",$linktitle . "|". $linkdescrip. "|" .$linkwords ."|" .$linkemail ."|" .$linkurl ."\n"); close(FILE1); print "Content-type: text/html\n\n"; print "<html><head><title>Thank You</title></head>\n"; print "<body><BR><h3><CENTER>Thank You For Adding to this database</CENTER></h3>\n"; print "</body></html>\n"; exit; } sub parse_form { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if (length($buffer) < 5) { $buffer = $ENV{QUERY_STRING}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } } sub open_file { local ($filevar, $filemode, $filename) = @_; open ($filevar,$filemode . $filename) || die ("Can't open $filename"); } sub read_file { local ($filevar) = @_; <$filevar>; } sub write_file { local ($filevar, $line) = @_; print $filevar ($line); } --=====================_905885571==_ Content-Type: TEXT/HTML; CHARSET=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: <Pine.SOL.3.91.980915211016.12028G@campus> <html><BR> <div align=3D"center"> &lt;!-----------------------------------------------------------------------= ---&gt;<br> &lt;!--=A0=A0=A0 <font size=3D4 color=3D"#FF0000"><b><i>LA P=C1GINA DEL ROTTWEILER</font></b></i><font size=3D3 color=3D"#000000">=A0=A0=A0=A0=A0=A0= --&gt;<br> &lt;!--=A0=A0=A0=A0=A0=A0=A0 <b>E-mail:</b> </font><font color=3D"#0000FF"><b><i>info@rottweiler.drago.net</b></i>=A0=A0= =A0=A0 </font><font color=3D"#000000">=A0 =A0=A0=A0=A0--&gt;<br> &lt;!--&nbsp;&nbsp; <a href=3D"http://www.dragonet.es/users/picolo/rot.htm" eudora=3D"autourl"><= b>http://www.lanzadera.com/ROTTWEILER</a>&nbsp;&nbsp; </b>--&gt;<br> &lt;!--=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0 <b>Jos=E9 Antonio Jara L=F3p= ez=A0</b>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 --&gt;<br> &lt;!--=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <b>Email:</b> </font><font color=3D"#0000FF"><b><i>picolo@dragonet.es</font></b></i><font = color=3D"#000000">=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 --&gt;<br> &lt;!-----------------------------------------------------------------------= ---&gt;<br> </font></html> --=====================_905885571==_-- --------- Pie de mensaje -------------------------------- Visite: http://tlali.iztacala.unam.mx/~randrade/perl.shtml Cancelar inscripcion: mail to: majordomo@tlali.iztacala.unam.mx text : cancelacion perl