Forum Moderators: coopster & phranque

Message Too Old, No Replies

Perl Backends!

Creating a meta-search engine

         

afamia

4:59 pm on Aug 26, 2003 (gmt 0)

10+ Year Member



Hi all ... would u plz help in this ... am creating a meta=search engine and am trying to use the Perl backends that we have in CPAN.org ... i can't find a way of using those backends ... this a sample program that they have in their website but i didn't know how to use it ...

Synopsis:

require WWW::Search;
$sEngine = "AltaVista";
$oSearch = new WWW::Search($sEngine);

Sample Program:

my $sQuery = 'Columbus Ohio sushi restaurant';
my $oSearch = new WWW::Search('AltaVista');
$oSearch->native_query(WWW::Search::escape_query($sQuery));
$oSearch->login($sUser, $sPassword);
while (my $oResult = $oSearch->next_result())
{
print $oResult->url, "\n";
} # while
$oSearch->logout;

Please Help ...

claus

5:11 pm on Aug 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi afamia, welcome to WebmasterWorld :)

Now, that's some task you've got going there. I don't mean to be rude, but i would not expect that the members here would actually deliver a meta-engine-in-a-box-script to you. On the other hand we are usually very helpful when it comes to specific problems.

So, what exactly is it in the above script that you can not get to work the way you wanted?

/claus

afamia

5:34 pm on Aug 26, 2003 (gmt 0)

10+ Year Member



ok... see this is my first time to use CGI ... and i really don't know what do i need to do in here ... is it just creating a CGI file and putting this code in it? ... its really confusing ... sorry about that ..

claus

6:37 pm on Aug 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, then a whole lot of things might cause problems before you even start but don't let that scare you, here's a quick checklist.

1) put the stuff in a plain text file
2) edit the first line so that it points to perl on your server, it probably looks like this - the "usr/bin/perl" is the part you must edit, not the rest:

#!/usr/bin/perl

3) if it's not there, include it - as the very first line, followed by a blank line
4) include this line right below it:

use CGI::Carp "fatalsToBrowser";

5) save the file as plain ascii text
6) make the file extension ".cgi" or ".pl"
7) upload the file to your /cgi-bin/ and make sure your FTP program is set to "transfer as ASCII"
8) change mode of the files to 755, it is done with the "CHMOD" feature of your FTP program
9) run the program by pointing your browser to it or whatever method is the right one for this program.

/claus