[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] Keystroke to search via search engine
From: |
Thorsten Glaser |
Subject: |
Re: [Lynx-dev] Keystroke to search via search engine |
Date: |
Tue, 6 Sep 2022 19:07:13 +0000 (UTC) |
Tim Chase dixit:
>I usually do this with an alias or shell function to populate the
>
>
>GET parameters, like
>
>
>
> $ goog() { lynx [2]https://google.com/search?q="$1" ; }
>
>
More escaping needed ☺
# GooGle Search
ggs() {
local _q _IFS
_IFS=$IFS
IFS=+
_q="$*"
IFS=$_IFS
${BROWSER:-lynx}
"http://www.google.com/search?hl=la&pws=0&num=100&safe=off&q=$_q"
}
# DuckDuckGo search
ddg() {
local _q _IFS _p=/ _a=
_IFS=$IFS
IFS=+
_q="$*"
IFS=$_IFS
case /${BROWSER:-lynx} in
(*/dillo*)
# make result page and target links work
_p=/lite/ _a='&kd=-1' ;;
(*/links*|*/lynx*)
# avoid automatic redirect
_p=/lite/ ;;
esac
${BROWSER:-lynx}
"https://duckduckgo.com$_p?kp=-1&kl=wt-wt&kb=t&kh=1&kj=g2&km=l&ka=monospace&ku=1&ko=s&k1=-1&kv=1&t=debian&q=$_q$_a"
}
Though some want space (+) to be replaced by %20, and # is still a problem.
bye,
//mirabilos
--
„Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund,
mksh auf jedem System zu installieren.“
-- XTaran auf der OpenRheinRuhr, ganz begeistert
(EN: “[…]uhr.gz is a reason to install mksh on every system.”)