Monday, October 10, 2005

Adam Suggest Getter Example

Suggest Getter Example

Type a keyword (or partial) in the text box below and click "Get Suggestion" to see a Google suggestions for that keyword... or select a sample keyword below. You may also be interested in my AdSense Getter example.

Keyword:
netcaptor130,000 results
netcaptor download52,600 results
netcaptor 7.5.35,570 results
netcaptor 7.5.4 crack151 results
netcaptor 7.5.44,520 results
netcaptor 7.5.3 crack133 results
netcaptor crack7,140 results
netcaptor.com1 result
netcaptor 7.5.3 serial211 results
netcaptor browser60,900 results

Try a sample...
NetCaptor, Scoble, Feed, Blog, RSS

Grab the code

Disclaimer: This site is not affiliated with Google.

Adam Styles - Hack Google Sugest

« Making Sure Your Visitors Can't Buy | Main | Hack Yourself »

December 10, 2004

Hacking Google Suggest

Google's Suggest feature is lighting up the blogosphere these days. It functions as like autocomplete for your search box, where Google attempts to determine what you are searching for and gives you suggestions. Web tinkerer that I am, I had to dig in a little and see how this works.

At its simplest, Google Suggest is javascript code that looks at what you are typing in the Google search box. When you press a key, GS phones home and passes the current contents of the search box. The server returns some suggestions are then displayed to the user. The javascript code is a little obfuscated, more to keep the size down than to obscure the contents. You can look at it here.

The script handles the onkeydown event of the search box. When that fires, it grabs the contents of the search box and sends the contents to a Google server for suggestions.

A request to the suggestion server looks like this:

http://www.google.com/complete/search?hl=en&js=true&qu=keyword

In return, the suggestion server returns some results as javascript. Here are the results that get returned when I have typed "netcaptor" in the box:

sendRPCDone(frameElement, "netcaptor", new Array("netcaptor", "netcaptor 7.5.3 crack", "netcaptor download", "netcaptor 7.5.3", "netcaptor crack", "netcaptor pro", "netcaptor 7.5.2", "netcaptor 7.5.3 serial", "netcaptor v7.5.3", "netcaptor review"), new Array("141,000 results", "169 results", "68,300 results", "2,890 results", "8,360 results", "56,500 results", "2,390 results", "213 results", "281 results", "15,900 results"), new Array(""));

Cool, huh?

Hacked appropriately, this could be a cool tool for generating related searches to a given keyword. Here's a quick, first attempt - I put together some sample code that grabs Google's suggestion for a given keyword (or partial). GPL'ed PHP source code is included.

Oh yeah - you might be interested in my earlier post about hacking Adsense for Feeds.