Added sequential iteration feature with persistant uid
This commit is contained in:
+35
-5
@@ -5,10 +5,14 @@
|
||||
<style>
|
||||
html{
|
||||
font-family: sans-serif;
|
||||
font-size: 14pt;
|
||||
width: 768px;
|
||||
}
|
||||
a {
|
||||
color: #547720
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<h1>KJV API</h1>
|
||||
<p>KJV accessible via web calls</p>
|
||||
@@ -38,17 +42,41 @@ API ENDPOINT SPECIFICATION v 0.3
|
||||
<a href="/search">/search</a> - returns a keyword search result set
|
||||
<a href="/show">/show</a> - returns a verse or set of verses by name/location
|
||||
<a href="/define">/define</a> - 1828 Noah Webster dictionary search
|
||||
<a href="/seq">/seq</a> - Incremental sequence of Bible verses (per request)
|
||||
|
||||
URL PARAMETERS
|
||||
==============
|
||||
?view=
|
||||
view=
|
||||
- json - json-encoded response
|
||||
- plain - plaintext response
|
||||
- rich - pretty response with css
|
||||
default: json
|
||||
|
||||
?kw=
|
||||
- The keyword(s) of your query.
|
||||
kw=
|
||||
- Used with /search /show/ /define /find
|
||||
- The keyword(s) of your query, separated by commas
|
||||
-- ex ?kw=1cor5:1-5,2Peter2:5
|
||||
|
||||
getuid=
|
||||
- Used only with /seq
|
||||
- Set this to "true" to recieve a new UID for use with /seq?uid=
|
||||
|
||||
start=
|
||||
- Used only with /seq
|
||||
- You can use a ref like "1Cor5:1" to start there
|
||||
instead of Genesis 1:1 as is the default
|
||||
- Only used when creating a new UID
|
||||
- If you want to "start in a new place" - just create a new UID
|
||||
|
||||
uid=
|
||||
- Used only with /seq
|
||||
- Required parameter for normal use of /seq
|
||||
|
||||
num=
|
||||
- Used only with /seq
|
||||
- You can get the "next # verses" in your sequence
|
||||
|
||||
|
||||
|
||||
|
||||
FEATURES
|
||||
@@ -56,7 +84,6 @@ FEATURES
|
||||
- King James Only. (No heretical commentaries or false Bibles)
|
||||
- High quality source documents
|
||||
- Free
|
||||
-
|
||||
- Developer hates the sodomites
|
||||
|
||||
INTERACTIVE ENDPOINTS
|
||||
@@ -77,6 +104,9 @@ 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
|
||||
===========
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<header>
|
||||
<a href="/">Home</a> | <a href="/find">Quick Search</a> |
|
||||
<a href="/random?view=rich">Random Verse</a> |
|
||||
<a href="/votd?view=rich">Verse of the Day</a></header>
|
||||
|
||||
<h2>Sequential Bible Viewer</h2>
|
||||
<p>In order to use this, you first need a UID, which you
|
||||
can get by querying /seq?getuid=true and optionally include
|
||||
&start=BIBLEREF (where BIBLEREF is like 1Cor2:1) to set
|
||||
a start position other than Genesis 1:1.</p>
|
||||
|
||||
<p>After you have your UID, this will keep track of where you
|
||||
are at. Query /seq?uid=YOURUID and optionally include
|
||||
&num=# (where # is an integer of how many verses you want to
|
||||
include from your current position at a time)</p>
|
||||
|
||||
<p>The &view= argument works with this.<p>
|
||||
|
||||
<h4>Example Pleroma Bot shell script</h4>
|
||||
<pre>
|
||||
<code>
|
||||
#!/bin/sh
|
||||
verse=$(curl -XGET https://api.1611.social/seq?uid=MYUID?view=plain);
|
||||
curl -XPOST -u biblebot:MYPASSWORD \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"status": "'"${verse}"'"}' \
|
||||
https://my.fediverse.tld/api/v1/statuses;
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<style>
|
||||
html{
|
||||
font-family: sans-serif;
|
||||
font-size: 14pt;
|
||||
width: 768px;
|
||||
}
|
||||
a {
|
||||
color: #547720
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user