diff --git a/.env b/.env index fbbfaa8..4743f61 100644 --- a/.env +++ b/.env @@ -1,2 +1,3 @@ -KJV_SERMON_DB="/home/tyler/kjv-api/sermon-analyzer/data/sermons.db" +KJV_SERMON_DB="./data/sermons.db" +# this does not do anything unless sermon_analyzer.py is running in tcp socket mode as a separate process KJV_SECRET_API_KEY="testing" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d39c5ca --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +logs/*.log +*__pycache__* diff --git a/app.py b/app.py index 99c2b8a..51d07ee 100644 --- a/app.py +++ b/app.py @@ -744,6 +744,10 @@ def make_view(response_list=[]): response = jsonify(response_list) +@app.get("/fe") +def frontend(): + return send_file('kjv_fe.html') + @app.get("/search") # user-facing keyword search. To be moved to backend, possibly replaced with semantic search. def search(): keywords = request.args.get("kw", None) diff --git a/data/notes b/data/notes new file mode 100644 index 0000000..579b1ed --- /dev/null +++ b/data/notes @@ -0,0 +1,3 @@ +https://www.sqlite.org/fts5.html +4.3.4. The Trigram Tokenizer + diff --git a/data/seq.db b/data/seq.db index 25e29e8..948f6b5 100644 Binary files a/data/seq.db and b/data/seq.db differ diff --git a/data/sermons.db b/data/sermons.db new file mode 100644 index 0000000..00b8644 Binary files /dev/null and b/data/sermons.db differ diff --git a/data/shortcodes.db b/data/shortcodes.db index 9401dec..9300b55 100644 Binary files a/data/shortcodes.db and b/data/shortcodes.db differ diff --git a/html/index.html b/html/index.html index 5cfe5a4..3daed8c 100644 --- a/html/index.html +++ b/html/index.html @@ -3,23 +3,83 @@ -

KJV API

-

KJV accessible via web calls

+

KJV API (Legacy edition)

-

Quick Search

-
+


@@ -76,9 +136,6 @@ num= - Used only with /seq - You can get the "next # verses" in your sequence - - - FEATURES ======== - King James Only. (No heretical commentaries or false Bibles) @@ -101,17 +158,6 @@ EXAMPLES api.tld/random api.tld/votd?view=rich api.tld/show?kw=john3:16,1john5:7&view=plain -api.tld/search?kw=faith -api.tld/search?kw=nimrod&view=rich -api.tld/define?kw=faith&view=rich -api.tld/define?kw=faith&view=rich -api.tld/seq?getuid=true&start=2peter2:1 -api.tld/seq?uid=075a8496-9af7-4f44-84ec-ba3e7fa6de29&view=rich - -INTEGRATION -=========== -If you want to put the verse of the day into your website, you can use the following example php: - echo curl_exec(curl_init('https://api.1611.social/votd?view=plain')); BUGS ==== diff --git a/kjv-api-test.sh b/kjv-api-test.sh index 4e0c2dd..83d8962 100755 --- a/kjv-api-test.sh +++ b/kjv-api-test.sh @@ -2,9 +2,9 @@ # run from current directory only FILE=app.py if test -f "$FILE"; then - uwsgi_python3 --http-socket 0.0.0.0:1612 --wsgi-file app.py --callable app --pyargv "-vvv" --stats 0.0.0.0:9192 + uwsgi_python310 --http-socket 0.0.0.0:1612 --wsgi-file app.py --callable app --pyargv "-vvv" --stats 0.0.0.0:9192 else cd /opt/kjv-api echo "WARNING: RUNNING FROM /opt/kjv-api" - uwsgi_python3 --http-socket 0.0.0.0:1612 --wsgi-file /opt/kjv-api/app.py --callable app --pyargv "-vvv" + uwsgi_python310 --http-socket 0.0.0.0:1612 --wsgi-file /opt/kjv-api/app.py --callable app --pyargv "-vvv" fi diff --git a/kjv-api.sh b/kjv-api.sh index f696fd4..f72c5f6 100755 --- a/kjv-api.sh +++ b/kjv-api.sh @@ -1,3 +1,3 @@ #!/bin/sh cd /opt/kjv-api -uwsgi_python3 --http-socket :1611 --wsgi-file /opt/kjv-api/app.py --callable app --stats 127.0.0.1:9191 +uwsgi_python312 --http-socket :1611 --wsgi-file /opt/kjv-api/app.py --callable app --stats 127.0.0.1:9191 diff --git a/kjv_fe.html b/kjv_fe.html new file mode 100644 index 0000000..c8bb75d --- /dev/null +++ b/kjv_fe.html @@ -0,0 +1,115 @@ + + + + + + Search + + + +

Bible Semantic Search

+

This is NOT a keyword search. This means searching single words will not have the results you expect. For that, use the normal keyword search at api.1611.social

+

Use a sentence like "The Lord will kill his enemies without mercy" - you are supposed to search an idea, not individual words.

+

Recent searches:

+ + + + + + + + diff --git a/logs/.include b/logs/.include new file mode 100644 index 0000000..e69de29 diff --git a/styles/header.css b/styles/header.css index ea7f6a5..fcc13dd 100644 --- a/styles/header.css +++ b/styles/header.css @@ -1,55 +1,70 @@ \ No newline at end of file +input[type=button], input[type=submit], input[type=reset] { + font-family: sans-serif; + background-color: #555; /* Dark button background */ + border: none; + color: #fff; /* Button text color */ + padding: 16px 32px; + text-decoration: none; + margin: 4px 2px; + cursor: pointer; +} + +.definition { + padding: 8px; + font-family: sans-serif; + font-size: 14.5pt; + width: 768px; + padding: 1px; + color: #fff; /* Text color */ + background-color: #222; /* Dark background */ +} + diff --git a/styles/header_dark.css b/styles/header_dark.css new file mode 100644 index 0000000..3202cc5 --- /dev/null +++ b/styles/header_dark.css @@ -0,0 +1,65 @@ + diff --git a/styles/header_light.css b/styles/header_light.css new file mode 100644 index 0000000..ea7f6a5 --- /dev/null +++ b/styles/header_light.css @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/styles/human_readable.css b/styles/human_readable.css index 73c3ea8..0cedf7f 100644 --- a/styles/human_readable.css +++ b/styles/human_readable.css @@ -7,4 +7,4 @@ a { color: #547720 } - \ No newline at end of file +