commit 21008338603dc930217aa8b18244478e66820e9d parent 7454786f8b2b41cce7551508169d70348324d436 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Tue, 7 Jan 2020 14:15:10 +0100 Add youtube search, via local idiotbox install if present, otherwise at codemadness.org Diffstat:
M | .local/bin/ducksearch | | | 14 | ++++++++++++++ |
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/.local/bin/ducksearch b/.local/bin/ducksearch @@ -22,6 +22,20 @@ else *!map*) $BROWSER "https://www.openstreetmap.org/search?query=${choice/!map/}" ;; + *!yt*) + idiotbox="~/code/idiotbox" + if [ -x "$idiotbox/cgi" ]; then + tmpfile=/tmp/yt.html + QUERY_STRING="q=$(printf '%s' "$choice" | tr ' ' '+')" \ + "$idiotbox/cgi" > "$tmpfile" + cp -r "$idiotbox/css" /tmp + $BROWSER "$tmpfile" + sleep 1 + rm "$tmpfile" + else + $BROWSER "https://codemadness.org/idiotbox/?q=${choice/!yt/}&o=relevance&m=Dark" + fi + ;; *) $BROWSER "https://duckduckgo.com/?q=$choice&kae=d&kau=-1&kao=-1&kap=-1&kaq=-1&kax=-1&kak=-1&kv=-1&kk=-1&k1=-1&kc=-1" ;;