PDA

View Full Version : Add "Search This Site" Functionality To Any Site...


digitalpoint
22-01-2004, 16:17/04:17PM
Hacked it together last night...

http://www.digitalpoint.com/tools/search/

Takes the programming complexity out of adding a "search this site" function to any website. It uses Google on the backend (via the Google API, so you don't break their TOS), which means you don't need a database or anything on your server.

The only requirement is that you need a PHP enabled web server.

- Shawn

ArmenT
23-01-2004, 02:45/02:45AM
Looks good, but you can do that even without a PHP enabled server. Google offers this service already:
http://www.google.com/searchcode.html#both

AndrewB
23-01-2004, 03:31/03:31AM
So this would mean all your website's pages have to be indexed by google and up to date?

digitalpoint
23-01-2004, 04:50/04:50AM
True, but Google's direct offering doesn't give you control of the look/feel of the results (basically hands you off to google.com).

- Shawn

Bernard
23-01-2004, 10:14/10:14AM
Shawn,

Thanks for continuing to offer free tools. :cheers:

I would hesitate on using a search facility tied to the API because if the site is popular, you might hit the API limit of 1000 searches and then it stops working!?! Or does this script require visitors to plug in their own API key? :eek:

ArmenT
23-01-2004, 11:52/11:52AM
>> but Google's direct offering doesn't give you control of the look/feel of the results
Yes, and they've always made their position clear about people not reformatting their results without ther permission. Your search results page makes NO mention of the fact that the results are from Google and does not display the Google logo prominently. From their api terms page:
"And you may not use the search results provided by the Google Web APIs service with an existing product or service that competes with products or services offered by Google."

I'm no lawyer myself, but I believe one can easily construe a trademark dilution or whatever, because they clearly do offer another service for you to search a site.

I'd hate to discourage a young hacker (heck, I've worn that badge proudly for years -- and I mean the true meaning of the word, not some script kiddie w4r3z d00d), but I'd far rather use the Google provided HTML than a PHP script calling their API and then reformatting their results.

digitalpoint
23-01-2004, 13:54/01:54PM
Bernard - Yeah, it would be limited to 1,000 searches per day. Although it would need to be a VERY big site I think. We use it on digitalpoint.com (we get about 35,000 unique visitors per day, and have the search box on all 100,000+ pages), and we end up getting about 150 searches per day.

ArmenT - {shrug} I'm not a lawyer either. If Google has a problem with it, I'm sure they will let me know. You could argue that use of the Google API competes with Google for *anything* you do with it in some way or another. One could say our keyword ranking checker (uses the Google API), competes because you can go to Google and do it manually.

- Shawn