Both Chrome and Firefox provide custom parameterized keyword aliases which turn your address bar into a powerful command line. They allow you to do some pretty cool stuff, but what you can do with them is somewhat limited by a lack of support for multiple %s parameters.
So yesterday, I published a Chrome extension that provides multiple-parameter URL aliasing.
I based it on Vinay Kumar‘s AliasLinks extension, but I improved the UX significantly and expanded the functionality to accept multiple parameters.
You can install the extension from the Chrome Web Store here.
Once it has been installed, a %s icon will show up to the right of the address bar. Clicking on it displays any currently defined aliases and provides you with a form for creating new aliases, with the URL field pre-populated with the address of the current page for convenience. You can leave that URL as-is, modify it to contain %s parameters, or of course overwrite it with whatever you want (though the UI will obviously only accept URL-shaped things).
See the Aliaser GitHub Page for details about how to define and use aliases. Read on for some examples of what you can do with them.
Single-parameter URL alias examples
For those of you who are new to the subject of parameterized URL aliases altogether, I’ll first provide some examples of single-parameter aliases you might choose to define.
Spanish Translation
Define this alias to translate an english word or phrase to spanish in one step.
Definition | spanishfor: http://translate.google.com/#en/es/%s |
Usage | a spanishfor Wow this is really awesome! |
Result | http://translate.google.com/#en/es/Wow%20this%20is%20really%20awesome! |
Amazon Search
This alias provides one step Amazon searches.
Definition | a: http://www.amazon.com/s/?field-keywords=%s |
Usage | a a 3 wolves howling at the moon |
Result | http://www.amazon.com/s/?field-keywords=3%20wolves%20howling%20at%20the%20moon |
Google Calendar Event Creation
One of my favorites, this alias lets you create Google Calendar events directly from the address bar.
Definition | cal: http://www.google.com/calendar/event?ctext=%s&action=TEMPLATE&pprop=HowCreated%3AQUICKADD |
Usage | a cal dinner and drinks with mom at 6pm at Galactic Pizza |
Result | https://www.google.com/calendar/render?ctext=dinner+and+drinks+with+mom+at+6pm+at+Galactic+Pizza&action=TEMPLATE&pprop=HowCreated:QUICKADD&sf=true&output=xml |
Multiple-parameter URL alias examples
Of course, while this extension provides a handy toolbar popup reference for your aliases, if you define the single-parameter searches above as custom search engines in Chrome instead, you can do away with the extra two keystrokes (a followed by a space) at the beginning of the commands.
The service this extension really provides over Chrome’s custom search engines is that it allows you to use multiple %s parameters in a URL.
Google Map with Optional Layer and Zoom
This Google Maps alias lets you optionally request a layer and zoom level together with an address.
Definition | map: https://maps.google.com/maps?q=%s&lci=%s&z=%s |
Usage | a map “7400 Sand Point Way NE Seattle WA” bike 22 |
Result | https://maps.google.com/maps?q=7400%20Sand%20Point%20Way%20NE%20Seattle%20WA&lci=bike&z=11 |
In the next example, the zoom level is left out, and we apply the transit layer instead of the bike layer.
Usage | a map “7400 Sand Point Way NE Seattle WA” transit_comp |
Result | https://maps.google.com/maps?q=7400%20Sand%20Point%20Way%20NE%20Seattle%20WA&lci=transit_comp |
Craigslist Sublets Search
This Craigslist alias lets you specify a city, a minimum and a maximum rent amount, and text search terms for 1-bedroom sublets.
In the first example, search terms are left out.
Definition | sublets: http://%s.craigslist.org/search/sub?zoomToPosting=&minAsk=%s&maxAsk=%s&bedrooms=1&query=%s |
Usage | a sublets seattle 800 1300 |
Result | http://seattle.craigslist.org/search/sub?zoomToPosting=&minAsk=800&maxAsk=1300&bedrooms=1&housing_type=&query= |
In the next example, the search terms “quiet area” are included:
Usage | a sublets seattle 800 1300 quiet area |
Result | http://seattle.craigslist.org/search/sub?zoomToPosting=&minAsk=800&maxAsk=1300&bedrooms=1&housing_type=&query=quiet+area |
GitHub Repository Search
This GitHub alias searches all repositories for a specified language, search terms, and results sort type. In this example, we’ll search for Python repositories which deal with the Facebook Graph API, and we sort the results by the number of stars the repository has received.
Definition | github: https://github.com/search?l=%s&o=desc&q=%s&ref=simplesearch&s=%s&type=Repositories |
Usage | a github python “Facebook Graph API” stars |
Result | https://github.com/search?l=python&o=desc&q=facebook%20graph%20API&ref=simplesearch&s=stars&type=Repositories |
If you install and use this extension, I’d love to hear how you end up using it.