One to Rule Them All – Custom Search Engines with Google Chrome

Searching for Answers

Tax avoiding billionaire celebrity bicycle faller-offer Bono once sang: “I still haven’t found what looking for”. Perhaps he wasn’t looking in the right place. I think he’d have had more luck if he used a custom search engine.

Normal search engines will scour the web to find content relevant to what you are looking for. There are 2 problems with this:

  • Not all of the web is accessible via search engine
  • Sometimes too much content is returned

Consider the first point raised here – if you use webmail such as GMail or Outlook, you can’t use a search engine to find that email you’re looking for, and rightly so. Instead, you must use the search facility provided by that mail provider.

Regarding the second point – in retrieving relevant content, a search engine may return several pages of results, and the user is faced with an exercise in separating the wheat from the chaff. Consequently, the user may restrict the search to content from a specific site – whilst this is possible using the site keyword, it’s a somewhat hamfisted approach in comparison to using a sites native search functionality if this exists – consider using Google to search for a forum post rather than forum search capabilities. The forum search functionality will be much more accurate, but it’d be nice to have the simplicity of a single search textbox that most search engines provide.

XDA Developer Forum - Not short on criteria

XDA Developer Forum – Not short on criteria

The Chrome Omnibox – Powerful yet Simple

If you’re a Chrome user, you’re familiar with the Omnibox – the address bar come search engine at the top of the window:

Web address on left, search criteria on right. Note the change in icons also.

Web address on left, search criteria on right. Note the change in icons also.

Type in a valid URL, hit enter and you’re taken to that webpage. Type anything else, hit enter and you’re taken to a page of search results for the criteria you just entered.

Such a simple, useful interface.

Let’s make it more useful, and add the ability to search webmail.

Custom Search Engine – GMail

Going back to my earlier point, I’d like to be able to use the Omnibox to search my GMail account. GMail already has this search functionality – I’d just like to be able to access it via the Omnibox.

Right click on the Omnibox and choose “Edit Search Engines”

edit

From the popup that appears, scroll down to “Other Search Engines”:

custom

Add a new row here with the following values:

New Search Engine GMail
Keyword gm
URL mail.google.com/u/0/search/%s

Then click the “Done” button.

Now click in the Omnibox, type gm then press Tab. Notice how your custom search engine is activated:

omniGmail

Type in your search criteria and hit enter – provided you are logged into Gmail (or Chrome) you will be redirected to the page of results in GMail:

omniGmail2

Custom Search Engine – Forum

Now on to the second point – how to use forum search functionality inside a nice simple interface like the Omnibox?

To lay some context, I’m an F1 fan who regularly visits PlanetF1.com. They have a user forum filled with commentary, rumour, opinions – the usual stuff. Quite often, stories will appear in the forum before the appear in the main site – forum users have other sources of information which they make public before any official announcement. They may or may not be true.

If you’ve never heard of Ross Brawn, you don’t know F1. He’s a highly respected F1 team boss who has achieved success with Benetton, Ferrari and even his own team, Brawn GP. He went on sabbatical a few years ago, seemingly leaving F1 and never to return. But there are always rumours of a comeback.

In short, I want a quick way to search the PlanetF1 forum for any topics that match the following criteria:

  • Any topic from the last 3 months
  • Within a specific subforum
  • Where my search text appears in the first post of the topic
  • Ordered most recent post first

Following the previous steps, I create a custom search engine with the following values:

New Search Engine PlanetF1
Keyword pf1
URL forum.planet-f1.com/search.php?keywords=%s&
terms=all&author=&fid%5B%5D=3
&sc=1&sf=firstpost&sk=t&sd=d&
sr=topics&st=90&ch=300&t=0&submit=Search

To use this search engine:

  • Click in the Omnibox
  • Enter the keyword (pf1)
  • Hit the Tab key to activate the custom search engine
  • Enter my search criteria (Ross Brawn)

rossbrawn2

Bingo!

GETting to the point – How does this work?

Pick any site you know of that provides search functionality. For the sake of argument, lets try BBC news, and search for something topical, such as “Sony hack”:

sonyhack

You are redirected to a page of results, but take note of the URL of this page:

http://www.bbc.co.uk/search?q=Sony%20hack

Let’s search for “Christmas Sales”. Again, note the URL of the page your are redirected to:

http://www.bbc.co.uk/search?q=Christmas%20sales

The URLs only differ by the search criteria entered here. This is an example of an http GET request, where the search criteria appears in the URL (as opposed to an http POST, where the search criteria is sent separately to the page request and thus does not appear in the URL).

The idea here is to create a template which uses characters that we enter from the Omnibox. In the case above, we substitute our search criteria with the %s wildcard thus:

New Search Engine BBC News
Keyword bbc
URL bbc.co.uk/search?q=%s

And hey presto – a custom BBC news search engine!

For Your Convenience…

I’ve compiled a list of custom search engine URLs that you may find useful. Note that you are free to name them as you like and set whatever keyword you fancy.

Social Media
Facebook facebook.com/search/results/?init=quick&q=%s
Twitter twitter.com/search?src=typd&q=%
Google+ plus.google.com/s/%s
Yammer yammer.com/#/Threads/Search?type=following&search=%s&search_source=global
LinkedIn linkedin.com/vsearch/f?type=all&keywords=%s
Webmail
GMail mail.google.com/mail/u/0/#search/%s
Inbox for GMail inbox.google.com/u/0/search/%s
Outlook dub125.mail.live.com/?fid=flsearch&srch=1&skws=%s&sdr=4&satt=0
News and Reference
BBC News bbc.co.uk/search?q=%s
Wikipedia en.wikipedia.org/w/index.php?search=%s&title=Special%3ASearch&go=Go
IMDb imdb.com/find?ref_=nv_sr_fn&q=%s&s=all
Buying Online
Amazon UK amazon.co.uk/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=%s
eBay UK ebay.co.uk/sch/i.html?_nkw=%s&_sacat=0
Streaming Media
YouTube youtube.com/results?search_query=%s
BBC iPlayer bbc.co.uk/iplayer/search?q=%s
Other
Google Drive drive.google.com/drive/#search?q=%s
Google Translate to French translate.google.co.uk/#auto/fr/%s
Google Translate to Spanish translate.google.co.uk/#auto/es/%s
Google Translate to German translate.google.co.uk/#auto/de/%s
Google Translate to Italian translate.google.co.uk/#auto/it/%s
Google Translate to Irish translate.google.co.uk/#auto/ga/%s

Go Forth and Multiply!

That’s just a handful of custom search engines I can think of off the top of my head. Use as many or as few as you like. Better yet, come up with a few of your own 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s