Perl programmer for hire: download my resume (PDF).
John Bokma Perl
freelance Perl programmer

Comments: Google Suggest program

3 comments

Google Suggest beta is a new toy available from the famous Google labs. As soon as you start to type something Google Suggest recognizes in the search field, a drop down menu appears under this field with several suggestions followed by the number of results available. Also, what you type is completed with what Google considers the best suggestion. The part added by Google is selected so when you keep typing it is deleted by what you type and hence a new suggestion (if available) will be given. You can also navigate the drop down list using the arrow keys to select a suggestion made by Google.

Read the rest of Google Suggest program.

Comments

I think the reason for google suggest's tremendous popularity was not its implementation, but the idea itself. I'm guessing this, because I've written a clone of it as well, called Golick Suggests (I will be blogging all the code and steps soon, so see my blog or email me if you're interested).

Although quite informative, I found the above article a touch long for its contents. For any experienced developer, creating a google suggests clone is really quite simple. One thing that I did like about it is that he used PHP.

PHP, although not that spectacular a language on its own, is perfect for using with AJAX, particularly in a situation like this. PHP does very little work, and all rendering and page generation is left up to javascript. Since most people simply use PHP for database accesses (as it is quite good at doing that in a very small amount of code), PHP works like a charm here.

The next step in all of this is to have php be able to serialize variables to a language that javascript can unserialize. Then passing data would be seemless..

Posted by Seo News at 22:33 GMT on 27 September 2006

Hi,

Google Suggest script is not a clone, nor is it written in PHP. It's a Perl program that obtains the suggestions Google offers for a query from Google's site directly.

As for serialization, check out JSON (JavaScript Object Notation). At the bottom you will find several JSON in PHP options (and for many other languages like Perl, Python, Ruby, Java, C#, etc.)

Posted by John Bokma at 03:38 GMT on 29 September 2006

This code no longer seems to be working, is it possible to revise so that it does fix?

Posted by Mike at 12:02 GMT on 27 January 2011

Post a comment

Note that your comment doesn't show up immediately. I review each comment before I add it to this site.

Check the Follow this page option if you want to receive an email each time a comment is posted to this page, including yours. A link to turn this option off will be included with each email.

Internet adresses will be converted automatically. You can use the following notation to specify anchor text for a link: [url=http://example.com/]example text[/url].