News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Martin Sik's Blog:
How to "steal" Google's "did you mean" feature
May 19, 2011 @ 12:49:32

In a a new tutorial posted on his blog Martin Sik shows you how to "steal" the "did you mean..." functionality that Google's sites currently offer. His example uses cURL to get the current Google request URLs and fetch the associated results.

I really like Google and the classic "did you mean" feature is really great, unfortunately when I wanted to implement it into my project a realized that it's not provided by any of Google's APIs. [...] I believe for most developers [having a large dictionary and extend the dictionary when new terms are available] are unachievable. And so it's for me. So I was thinking if I can bypass these drawbacks and let Google do all the job for me.

The source code is included with the post showing two methods - fetching a "did you mean" block to parse or how a term is attached to a Google URL and the results are returned in JSON and parsed for display. Obviously, this is an external dependency you could consider if you put it into your application, but it can be quite a powerful tool in the right situations.

0 comments voice your opinion now!
google suggestion feature curl url json


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Installing PHP Extensions on Nitrous.io

Gonzalo Ayuso: Google App Engine, PHP and Silex. Setting up a Login Provider

Daniel Hofstetter's Blog: Accepting the Google OpenID with PHP OpenID

User Group: New York PHP Meeting - July 27th @ 6pm (Nate Abele & Hans Zaunere on PHP 5.3)

IBM developerWorks: What's new in Zend Framework V1.5


Community Events





Don't see your event here?
Let us know!


package version security community framework symfony introduction interview release composer series voicesoftheelephpant mvc update podcast language tool laravel opinion library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework