scripts for my gemini capsule
bibles: fix the web
| -rwxr-xr-x | index.gmi | 1 | ||||
| -rwxr-xr-x | webp.py | 10 |
2 files changed, 6 insertions, 5 deletions
@@ -6,6 +6,7 @@ printf '20 text/gemini \r\n ## Experimental bible reading scripts => /cgi-bin/net.sh Wrapper for New English Translation API. => /cgi-bin/oeb.py Open English Bible (WIP) rough-ish script for reading. +=> /cgi-bin/webp.py World English Bible reading script ## misc => /cgi-bin/oebindex.sh Index for Open English Bible current completed books @@ -19,7 +19,8 @@ def main(qs): if not qs: print("10 Enter a scripture reference\r\n") return - + books=subprocess.check_output([f"find", "webp/", "-name", f'??-*.usfm']).strip().split(b"\n") + books.sort() passages = parse_string(qs) # TODO: Also handle "john 3, tomato 2" errors? if type(passages[0]) == tuple: @@ -32,10 +33,9 @@ def main(qs): print("# " + passage.format()) printing = 0 inendc = False - bookabbrev = passage.start.format('a').upper() - eprint(bookabbrev) - fname = subprocess.check_output([f"find", "webp/", "-name", f'*-{bookabbrev}*']).strip() - f = open(fname) + bookn = passage.start.book + eprint(bookn) + f = open(books[bookn]) startc = passage.start.chapter startv= passage.start.verse endc = passage.end.chapter |