scripts for my gemini capsule
Bible: add esv api wrapper
Zach DeCook 2021-02-22
parent 4aa90f0 · commit b3285ce
-rwxr-xr-xesv.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/esv.sh b/esv.sh
new file mode 100755
index 0000000..e31d721
--- /dev/null
+++ b/esv.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+if [ "$QUERY_STRING" = "" ]
+then
+ printf "10 Enter a scripture reference\r\n"
+ return
+fi
+
+printf "20 text/gemini\r\n"
+
+qs="$(echo "$QUERY_STRING" |sed 's/ /\+/g')"
+printf "=> http://www.esvapi.org This page's contents pulled from esvapi.org.\n#"
+req="$(printf 'http://www.esvapi.org/v2/rest/passageQuery?key=TEST&passage=%s&include-headings=false&output-format=plain-text&include-verse-numbers=false&include-footnotes=false&line-length=0&include-first-verse-numbers=false&include-passage-horizontal-lines=false&include-heading-horizontal-lines=false&include-subheadings=false' "$qs")"
+#echo $req
+curl "$req"