Link to home
Start Free TrialLog in
Avatar of ifeatu
ifeatu

asked on

Perl script / Curl

I need a Perl script or curl command that searches google.com for a given string...been thru all kinds of documentation on curl and coming up with nothing...can anyone help?
Avatar of Tintin
Tintin

When you say you want to search google.com for a given string, do you mean you want to perform a Google search or search for a string on the google page?
Avatar of ifeatu

ASKER

yes.  I want to run a google search and show only the top 5 results.
ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ifeatu

ASKER

Thanks...worthy of the title Genius!
Avatar of ifeatu

ASKER

Hey...I tried using that Perl Module I tried using the get and the 'put' feature, but for some reason I cannot procure the output...here is my code using the 'put' command...the output is absolutely nothing.
use WWW::Mechanize;
 
my $mech = WWW::Mechanize->new();
$mech->put('http://www.google.com/#q=string', 'test' => $tempfile );
print $tempfile;

Open in new window

Did you get it figured out?  If $tempfile is the name of a file, you can not upload it like that.
Avatar of ifeatu

ASKER

No i didn't :-( Still need help I'm a n00b.
What are you trying to do?  To get the contents from the google page, you can use:
use WWW::Mechanize;
 
my $mech = WWW::Mechanize->new();
$mech->get('http://www.google.com/#q=string');
print $mech->content;

Open in new window