I have a customer who wants to use a search script to search outside his site. How is this done? Am I talking about reinventing Google or what?
| SitePoint Sponsor |



I have a customer who wants to use a search script to search outside his site. How is this done? Am I talking about reinventing Google or what?
Opportunity favors the prepared mind.


Sort of depends on what they want to accomplish - would just using "site:" in a regular google search be good enough, or do they want to display results on their own site? If so, and if the other site has it's own internal search, it may be possible to use a middleman script that sends the query to the other site, grabs the results, and then parses them to display on the client's site.



They want to display on their own site. They want up-to-date results, daily I guess. They want to search within each link for keyword, not just titles or tags. It would be similar to asking someone to search sitepoint for the keyword, "php" and every record that contains php would be on the list.
Opportunity favors the prepared mind.

is there a certain set of sites your customer wants to search? or do they want to search "all of the internet"?
Check out our new Industry News forum!
Keep up-to-date with the latest SP news in the Community Crier
I edit the SitePoint Podcast


Perhaps google's ajax search API would help?
http://code.google.com/more/#products-search-ajaxsearch
Yes, I also would recommend not to write a Perl script but just use one of the big search engines and integrate them into your client's website.
Of course, using a CGI script, you could perform a Google search in the background, then with some regular expressions figure out the search results and display them in a custom format - but very likely this is against Google's use policy ;-) At least, unless you sign a contract with them paying for this service.
Business consulting services: http://www.starenterprise.com
CGI Perl scripts and software: http://www.sunnyscript.com
Thousands of sites have been hacked recently.
Unmask Parasites: Check if your site is still yours.
Or does your client want something unlabelled, so used under their own name ? In this way, also Google can be your friend - they sell a search engine appliance. Very expensive, but may work. Check out their website for details.
Business consulting services: http://www.starenterprise.com
CGI Perl scripts and software: http://www.sunnyscript.com
Bookmarks