about summary refs log tree commit diff
path: root/esv.sh
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-02-22 08:07:24 -0500
committerZach DeCook <zachdecook@librem.one>2021-02-22 08:07:24 -0500
commitb3285ce6bb2f9f257af7755999587e438be4f7f5 (patch)
treed09c2c6233300a8249133480a8d35d0a667303ae /esv.sh
parent4aa90f0c0cf3400728152a33d20fc8d6d37b6532 (diff)
downloadcgi-bin-b3285ce6bb2f9f257af7755999587e438be4f7f5.tar.gz
Bible: add esv api wrapper
Diffstat (limited to 'esv.sh')
-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"