O'Reilly logo

Greasemonkey Hacks by Mark Pilgrim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #51. Link to Other Search Engines from Google

Make Google even more useful by adding links to competitors.

When Google was young and scrappy (circa 2001), it had an interesting feature. At the bottom of the search results page, Google offered links to try your search on the other major search engines of the day: AltaVista, Hot-bot, Excite, and a few others. The thinking behind it was that maybe you didn't find what you were looking for this time, but you should still try Google first on your next search.

Google is all grown up now, and they are the undisputed king of web search. Somewhere along the way to the top, they quietly dropped this feature. This hack brings it back.

The Code

This user script runs on Google search result pages. It retrieves the original query from the search form at the top of the page, then constructs a list of links to other search engines and inserts them at the top of the search results.

Save the following user script as tryyoursearchon.user.js:

	// ==UserScript==
	// @name		   Try Your Search On
	// @namespace	   http://diveintomark.org/projects/greasemonkey/
	// @description	   Link to competitors from Google search results // @include http://www.google.tld/search* // ==/UserScript== // based on Butler // http://diveintomark.org/projects/butler/ function getOtherWebSearches(q) { q = escape(q); return '' + '<a href="http://search.yahoo.com/search?p=' + q + '">Yahoo</a>, ' + '<a href="http://web.ask.com/web?q=' + q + '">Ask Jeeves</a>, ' + '<a href="http://alltheweb.com/search?q=' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required