|
Cookbook /
Do the Right ThingSummary: Link shortcuts to custom searches for your browser
Version: 20110408
Prerequisites:
Status: beta
Maintainer: Petko
Discussion: DoTheRightThing-Talk
DescriptionUse a wiki page to create and edit link shortcuts to a number of predefined custom searches.. The feature is similar to the InterMap feature, but is directly embedded in your browser. This is a productivity enhancement for those who use Internet a lot and PmWiki for Personal Information Management. The user can type a "keyword" and some "search terms" in her browser address bar, and the browser will automatically open the search results page based on the keyword. For example, typing in the address bar There is a benefit to use a wiki page instead of browser "bookmark shortcuts" if you use more than one computer or more than one browser. Your shortcuts are very easy to add and edit, and will always be up-to-date in all browsers. Installation
include_once("(You can select any page you wish. This page will contain your shortcut definitions.) Shortcut configurationIn your selected wiki page, for example Main.DTRT, add the link shortcuts in this format: gi: http://images.google.com/images?q=$1 : Google images fm: http://freshmeat.net/search/?section=projects&q=$1 : Freshmeat (software) php: http://php.net/search.php?lang=en&show=quickref&pattern=$1 : PHP manual map,maps: http://www.google.com/maps?q=$1 : Search Google Maps pm: http://www.pmwiki.org/wiki/?action=search&q=$1 : search PmWiki.org imdb: http://www.imdb.com/find?s=all&q=$1 : search IMDB for movies On the shortcut line, there is a "keyword" followed by a ":" colon, spaces and the url address of the search related to this keyword. The address contains "$1" which will be replaced with the search terms. At last, after another colon, you can have some optional comment. You can have more than one shortcut for an address, separate them with commas like the The recipe has 3 default shortcuts built-in: "g" to search Google, "w" for Wikipedia in English, and a "_default" search when no shortcut was recognized. You can change the default shortcuts by simply redefining them in the Main.DTRT page: _default: https://ssl.scroogle.org/cgi-bin/nbbwssl.cgi?Gw=$1 : Set Scroogle as default On that same page, you can add a form allowing searches from browsers that are not configured. For example, you can place at the top of the page:
(:input form action="{$PageUrl}" method=get:)
(:input hidden action dtrt:)(:input text q size=40:)(:input submit value="Do!":)
(:input end:)
Browser configurationYou need to instruct your browser to send searches to your Main.DTRT wiki page (the recipe will then redirect to the selected search). Your custom address is that of the Main.DTRT page followed by
UsageTo search Internet, in your browser press F6 or Ctrl+T to focus the address bar, then enter the search shortcut, a space, then the search terms, and press Enter. For example, entering Notes
Release notes
See alsoContributorsPetko is the author and the maintainer of the recipe. I've been using and advocating in-browser search shortcuts for years but the idea to use a wiki page came to me when I found "DTRT: A CGI Script to Do The Right Thing" by Gerald Oskoboiny. CommentsSee discussion at DoTheRightThing-Talk User notes +2: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |