def _test(self, arg): """tests a command on a different bunny1 host. usage: _test [fully-qualified-bunny1-url] [command]""" (bunny1_url, arg) = arg.split(None, 1) if not bunny1_url.endswith("?"): bunny1_url += "?" save("bunny1testurl", bunny1_url) raise HTTPRedirect(bunny1_url + q(arg))
def fblucky(self, arg): """facebook i'm feeling lucky search, i.e. go directly to a person's profile""" return "http://www.facebook.com/s.php?jtf&q=" + q(arg)
def hoo(self, arg): """a hoogle (haskell + google) search""" return "http://haskell.org/hoogle/?q=%s" % q(arg)
def map(self, arg): """google maps""" if arg: return "http://maps.google.com/maps/?q=" + q(arg) else: return "http://maps.google.com"
def go(self, arg): """google I'm feeling lucky search""" if arg: return "http://www.google.com/search?btnI&q=" + q(arg) else: return "http://www.google.com/"
def hoo(self, arg): """hoogle search""" if arg: return "http://www.haskell.org/hoogle/?hoogle=" + q(arg) else: return "http://www.haskell.org/hoogle"
def _t(self, arg): """tests a command on the most recently used bunny1 host. usage: _t [command]""" bunny1_url = load("bunny1testurl") raise HTTPRedirect(bunny1_url + q(arg))
def g(self, arg): """does a google search. we could fallback to yubnub, but why do an unnecessary roundtrip for something as common as a google search?""" return GOOGLE_SEARCH_URL + q(arg)
def fallback(self, raw): raise HTTPRedirect(self.fallback_url + q(raw))