Smart URLs: In-URL searching
The current situationSay you’re interested in buying the “Underworld” DVD from Amazon. You have to:
- type Amazon’s URI in your browser’s address bar:
http://amazon.com/(note: thehttp://part can be omitted, we know, but it’s here so that it’s easier to understand we’re talking about a URI) - wait for Amazon’s front page to load
- type “underworld” in the search field
- wait for the search results to come up (where the link to the “Underworld” DVD shows up)
A proposal
Wouldn’t it be nice, if you could just type
http://amazon.com/underworld in the address bar, and get straight to the search results for “underworld”? It’s easy, and it saves you time, so why not?
Google —or any website where search is an important function— could implement this technique too. For example,
http://google.com/blogpad should bring up the search results for “blogpad”.
Note: Google has got a “hackable” URL for that purpose (which most “geeks” use), but
http://google.com/search?q=blogpad isn’t as memorable as http://google.com/blogpad.
Easy to implement
I did a small research, and it turns out someone has already implemented this. Typing
http://php.net/echo brings up the manual entry for the “echo” command. The techheads over at PHP.net have also written a HOWTO on the topic: “URL Howto”.
A9, Amazon’s search engine startup, also uses this, and they make sure to mention it in their “What’s New & Cool” page:
URL Short Cuts: At A9.com you can search directly from the browser URL box by typing: a9.com/query
So, why hasn’t Amazon implemented this yet? And what about Google? This is a way to make our online wanderings a bit easier.
Taking the idea a bit further
A couple of suggestions to increase this techinque’s efficiency:
Underscores and spaces
http://amazon.com/celine_dion should bring up the search results for “celine dion”; not “celine_dion”.
For all the other sites (Google, PHP.net, etc.), where the queried items’ names may include an underscore, the underscore in the Smart URL should represent an underscore, and not a space. For example
http://google.com/hello_world should bring up the search results for “hello_world”; not “hello world”.
In these cases, another character or keyboard sequence should be used to represent a space (“
|” maybe?).UPDATE (and why I deleted that part above): As pointed out by “Complex” in the comments below (who also pointed out that A9 has the “Smart URL” feature enabled), there is no need for all that fuss. I had forgotten that you can simply have URLs with spaces inside.
So, when the query contains a space —use one; when it contains an underscore— use one:
http://a9.com/celine dion and http://a9.com/hello_world
Extra switches
We shall explain this with an example:
http://amazon.com/dvd/underworld brings up the search results for the “Underworld” DVD, while http://amazon.com/cd/underworld brings up the search results for the “Underworld” OST.
The use of these switches (in our example,
/dvd/ and /cd/) is entirely optional, which means that: http://amazon.com/underworld still works, but brings up all the products that carry the “underworld” word on their name.
This is an ol’ Blogpad entry.
Originally published: 04/01/2002 12:19:45 AM
Blogger Post ID: 11317578
