diff options
author | Brent Yorgey <byorgey@gmail.com> | 2008-04-02 17:05:21 +0200 |
---|---|---|
committer | Brent Yorgey <byorgey@gmail.com> | 2008-04-02 17:05:21 +0200 |
commit | c12eb631523eb5acea75ebd4f21580f192e6ae78 (patch) | |
tree | 06e300192750687338b6bedece320451b3889d42 | |
parent | 9ead5a144ffacde46b0c853950cb451cedad6de0 (diff) | |
download | XMonadContrib-c12eb631523eb5acea75ebd4f21580f192e6ae78.tar.gz XMonadContrib-c12eb631523eb5acea75ebd4f21580f192e6ae78.tar.xz XMonadContrib-c12eb631523eb5acea75ebd4f21580f192e6ae78.zip |
Actions/Search.hs: add dictionary.com search
darcs-hash:20080402150521-bd4d7-fe7567e79447a04e3b049b0d77aa97c8a3567262.gz
-rw-r--r-- | XMonad/Actions/Search.hs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs index 8e9387e..614444a 100644 --- a/XMonad/Actions/Search.hs +++ b/XMonad/Actions/Search.hs @@ -22,6 +22,7 @@ module XMonad.Actions.Search ( -- * Usage selectSearchBrowser, amazon, + dictionary, google, hoogle, imdb, @@ -70,6 +71,8 @@ import XMonad.Util.XSelection (getSelection) * 'amazon' -- Amazon keyword search. +* 'dictionary' -- dictionary.com search. + * 'google' -- basic Google search. * 'hoogle' -- Hoogle, the Haskell libraries search engine. @@ -182,15 +185,17 @@ simpleEngine :: Query -> SearchEngine simpleEngine site query = site ++ escape query -- The engines. -amazon, google, hoogle, imdb, maps, mathworld, scholar, wayback, wikipedia :: SearchEngine -amazon = simpleEngine "http://www.amazon.com/exec/obidos/external-search?index=all&keyword=" -google = simpleEngine "http://www.google.com/search?num=100&q=" -hoogle = simpleEngine "http://www.haskell.org/hoogle/?q=" -imdb = simpleEngine "http://www.imdb.com/Find?select=all&for=" -maps = simpleEngine "http://maps.google.com/maps?q=" -mathworld = simpleEngine "http://mathworld.wolfram.com/search/?query=" -scholar = simpleEngine "http://scholar.google.com/scholar?q=" -wikipedia = simpleEngine "https://secure.wikimedia.org/wikipedia/en/wiki/Special:Search?go=Go&search=" +amazon, dictionary, google, hoogle, imdb, maps, mathworld, + scholar, wayback, wikipedia :: SearchEngine +amazon = simpleEngine "http://www.amazon.com/exec/obidos/external-search?index=all&keyword=" +dictionary = simpleEngine "http://dictionary.reference.com/browse/" +google = simpleEngine "http://www.google.com/search?num=100&q=" +hoogle = simpleEngine "http://www.haskell.org/hoogle/?q=" +imdb = simpleEngine "http://www.imdb.com/Find?select=all&for=" +maps = simpleEngine "http://maps.google.com/maps?q=" +mathworld = simpleEngine "http://mathworld.wolfram.com/search/?query=" +scholar = simpleEngine "http://scholar.google.com/scholar?q=" +wikipedia = simpleEngine "https://secure.wikimedia.org/wikipedia/en/wiki/Special:Search?go=Go&search=" {- This doesn't seem to work, but nevertheless, it seems to be the official method at <http://web.archive.org/collections/web/advanced.html> to get the latest backup. -} @@ -214,7 +219,6 @@ promptSearch config engine = liftIO getBrowser >>= \ browser -> promptSearchBrow -- | Like 'search', but for use with the X selection; it grabs the selection, -- passes it to a given searchEngine and opens it in a given browser. --- selectSearchBrowser :: Browser -> SearchEngine -> IO () selectSearchBrowser :: Browser -> SearchEngine -> X () selectSearchBrowser browser searchengine = search browser searchengine =<< getSelection |