script to call google search?

Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

script to call google search?

 
0
  #1
Aug 25th, 2006
Hey everyone, I need a little snippet of code that I can use to call a google search. I know I can just use html to link to a google search with a predefined search string in the search box, but what I'd like to do is create a little text box where my users can input a search term and click "search", and then the code would pass that search on to google. I know it's easier just to go to google and type in the search yourself, but I need extra predefined text added to the search string in addition to what the user inputs to the search box.

Here's the example. The user types in the search box, "computers."

I would like the script to place the word "computers" in some other search text, say, "future of" + "computers" + "family values". Or something to that effect. So basically, I want the script to take the {user search} and call a google search with that {user search} placed in the middle of my predefined search terms.

Any ideas?
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 229
Reputation: DavidRyan is an unknown quantity at this point 
Solved Threads: 11
DavidRyan's Avatar
DavidRyan DavidRyan is offline Offline
Posting Whiz in Training

Re: script to call google search?

 
0
  #2
Aug 25th, 2006
DELETE: Don't mind me, didn't notice this was for PERL
Last edited by DavidRyan; Aug 25th, 2006 at 2:37 am.
Please anyone, correct me if I am wrong. It is the best way for me to learn.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: script to call google search?

 
0
  #3
Aug 25th, 2006
Well, that would work, only I'm hosting on a unix system, so I need to use perl or php or something. ASP or VB won't really work.
Thanks though!
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: script to call google search?

 
0
  #4
Aug 25th, 2006
I think I found something that will work. I wrote it in perl. Basically the form calls the script, and the script just uses a redirect and redirects to a google page with the search criteria in the scipt, as well as whatever the user puts in the form. It seems to be working. Thanks!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Perl Forum


Views: 4174 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Perl
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC