#!/bin/sh
# esv api v2 is deprecated.
# I'm not planning on jumping thru Crossway's hoops again for this.
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 content 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"
# Include an ending newline.
echo ''