summary refs log tree commit diff
path: root/home/.local/bin/wiki
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-07-24 17:34:24 -0400
committerJune McEnroe <june@causal.agency>2019-07-24 17:34:24 -0400
commit44fa22f89e674912627a52d8f4f9593f8ff5476e (patch)
treed435f33cb0a39c8dae0865b8310684675491ad96 /home/.local/bin/wiki
parentAdd beginning of date calculator (diff)
downloadsrc-44fa22f89e674912627a52d8f4f9593f8ff5476e.tar.gz
src-44fa22f89e674912627a52d8f4f9593f8ff5476e.zip
Add wiki script
Diffstat (limited to '')
-rwxr-xr-xhome/.local/bin/wiki7
1 files changed, 7 insertions, 0 deletions
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"
a36d6b3e2fb44a73e071cf4bf41&follow=1'>Actually port awesome config to 3.5June McEnroe 2013-01-26Make pretty zshrcJune McEnroe 2013-01-26Port awesome config to 3.5June McEnroe 2013-01-26Replace RVM with chrubyJune McEnroe