summary refs log tree commit diff
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
commit15f560575fb935acc214a4f9ce4402f4193fd0c6 (patch)
treefb1988510001e19e6a4ad8a2420328dbea434c13
parentAdd beginning of date calculator (diff)
downloadsrc-15f560575fb935acc214a4f9ce4402f4193fd0c6.tar.gz
src-15f560575fb935acc214a4f9ce4402f4193fd0c6.zip
Add wiki script
-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"