944,161 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 5257
  • Perl RSS
Aug 25th, 2006
0

script to call google search?

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Posting Whiz in Training
nathanpacker is offline Offline
234 posts
since May 2005
Aug 25th, 2006
0

Re: script to call google search?

DELETE: Don't mind me, didn't notice this was for PERL
Last edited by DavidRyan; Aug 25th, 2006 at 2:37 am.
Reputation Points: 22
Solved Threads: 11
Posting Whiz in Training
DavidRyan is offline Offline
229 posts
since Jul 2006
Aug 25th, 2006
0

Re: script to call google search?

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!
Reputation Points: 10
Solved Threads: 0
Posting Whiz in Training
nathanpacker is offline Offline
234 posts
since May 2005
Aug 25th, 2006
0

Re: script to call google search?

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!
Reputation Points: 10
Solved Threads: 0
Posting Whiz in Training
nathanpacker is offline Offline
234 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: modify script
Next Thread in Perl Forum Timeline: LWP HTML ::TokeParser - running against a bulletin board





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC