scripts for my gemini capsule
Bible: Add NET bible API wrapper
| -rwxr-xr-x | net.sh | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +#!/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 "=> https://labs.bible.org This content pulled from bible.org.\n" +# TODO: use &type=xml&formatting=para +req="$(printf 'https://labs.bible.org/api/?passage=%s&type=text' "$qs")" +#echo "$req" +echo "#$qs" | sed 's/+/ /g' +curl "$req" | sed 's@<b>[0-9:]*</b>@@g' +# end with a newline +echo '' +echo '(NET)' |