From 44fa22f89e674912627a52d8f4f9593f8ff5476e Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Wed, 24 Jul 2019 17:34:24 -0400 Subject: Add wiki script --- home/.local/bin/wiki | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 home/.local/bin/wiki (limited to 'home') diff --git a/home/.local/bin/wiki b/home/.local/bin/wiki new file mode 100755 index 00000000..c4308098 --- /dev/null +++ b/home/.local/bin/wiki @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu + +curl -Gs 'https://en.wikipedia.org/w/api.php' \ + -d 'action=opensearch' --data-urlencode "search=$1" \ + | jq -r '.[2][]' \ + | sed -En "s/^([^ ]| [^i]| i[^s]| is[^ ])* is /It's not a $1, what we need is /p" -- cgit 1.4.1