widebible 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +251 -0
- data/lib/widebible/client.rb +253 -0
- data/lib/widebible/version.rb +5 -0
- data/lib/widebible.rb +4 -0
- metadata +54 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f41d0970273a19e1e291ea26f15b158f12883e7e77343c3586d6dd3b841d90d5
|
|
4
|
+
data.tar.gz: 485fb9bacde4dc583d6ccb6a2666e8adc48cd204fbd91a185c5b754448f1c92f
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9e8528b7bf01b2cd96bed8f2803f60708d7b7665d71acaba40ffce88ebd71dae0d5aff5f078d59b8852433808811d292ef48bd4afbdcfa05959c6adc07228f6b
|
|
7
|
+
data.tar.gz: 6626176329206faf26faa2d33fd7dff9baf7be73139044b0009619fcc235d3ae205ddd160a1ae45e3ccfd6ea25b8e2abed930edcaacbb56659d69d4db7f3fbf9
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WideHoly
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# widebible
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/widebible)
|
|
4
|
+
[](https://www.ruby-lang.org/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://rubygems.org/gems/widebible)
|
|
7
|
+
|
|
8
|
+
Ruby client for the [WideBible](https://widebible.com) API. Access all 66 books of the Bible, 31,102 verses across 4 translations (KJV, ASV, BBE, YLT), biblical people, places, topics, cross-references, glossary with Hebrew and Greek terms, timeline events, and reading plans. Zero runtime dependencies -- uses only Ruby stdlib (`net/http`, `json`, `uri`).
|
|
9
|
+
|
|
10
|
+
WideBible is a comprehensive Bible encyclopedia and scripture platform providing structured verse data, cross-references between passages, biographical profiles of biblical figures, geocoded holy sites, and thematic verse collections -- all accessible through a free REST API.
|
|
11
|
+
|
|
12
|
+
> **Explore the Bible at [widebible.com](https://widebible.com)** -- [Books](https://widebible.com/books/), [People](https://widebible.com/people/), [Places](https://widebible.com/places/), [Topics](https://widebible.com/topics/) , [Timeline](https://widebible.com/timeline/)
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Install](#install)
|
|
17
|
+
- [Quick Start](#quick-start)
|
|
18
|
+
- [What You Can Do](#what-you-can-do)
|
|
19
|
+
- [Browse Bible Books](#browse-bible-books)
|
|
20
|
+
- [Look Up Verses](#look-up-verses)
|
|
21
|
+
- [Search Scripture](#search-scripture)
|
|
22
|
+
- [Explore Biblical People](#explore-biblical-people)
|
|
23
|
+
- [Discover Holy Places](#discover-holy-places)
|
|
24
|
+
- [Follow Cross-References](#follow-cross-references)
|
|
25
|
+
- [Study Glossary Terms](#study-glossary-terms)
|
|
26
|
+
- [Walk the Timeline](#walk-the-timeline)
|
|
27
|
+
- [Follow Reading Plans](#follow-reading-plans)
|
|
28
|
+
- [API Reference](#api-reference)
|
|
29
|
+
- [Learn More About the Bible](#learn-more-about-the-bible)
|
|
30
|
+
- [WideHoly Scripture Family](#wideholy-scripture-family)
|
|
31
|
+
- [Also Available](#also-available)
|
|
32
|
+
- [License](#license)
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
gem install widebible
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or add to your Gemfile:
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
gem "widebible"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Quick Start
|
|
47
|
+
|
|
48
|
+
```ruby
|
|
49
|
+
require "widebible"
|
|
50
|
+
|
|
51
|
+
# Create a client (zero configuration needed)
|
|
52
|
+
client = WideBible::Client.new
|
|
53
|
+
|
|
54
|
+
# List all 66 books of the Bible
|
|
55
|
+
books = client.list_books
|
|
56
|
+
puts books["results"].first["name"] # => "Genesis"
|
|
57
|
+
|
|
58
|
+
# Get a specific verse -- John 3:16 in the KJV
|
|
59
|
+
verse = client.get_verse("john", 3, 16)
|
|
60
|
+
puts verse["results"].first["text"]
|
|
61
|
+
|
|
62
|
+
# Search across all scripture
|
|
63
|
+
results = client.search("In the beginning")
|
|
64
|
+
results["results"].each { |v| puts v["reference"] }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## What You Can Do
|
|
68
|
+
|
|
69
|
+
### Browse Bible Books
|
|
70
|
+
|
|
71
|
+
The Bible contains 66 books divided into the Old Testament (39 books) and New Testament (27 books). Books are organized into groups: Pentateuch, Historical Books, Wisdom Literature, Major Prophets, Minor Prophets, Gospels, Pauline Epistles, General Epistles, and Revelation.
|
|
72
|
+
|
|
73
|
+
```ruby
|
|
74
|
+
# List all books of the Bible
|
|
75
|
+
books = client.list_books
|
|
76
|
+
|
|
77
|
+
# Get details for a specific book
|
|
78
|
+
genesis = client.get_book("genesis")
|
|
79
|
+
puts genesis["name"] # => "Genesis"
|
|
80
|
+
puts genesis["chapter_count"] # => 50
|
|
81
|
+
|
|
82
|
+
# Browse book groups (Pentateuch, Gospels, etc.)
|
|
83
|
+
groups = client.list_book_groups
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Look Up Verses
|
|
87
|
+
|
|
88
|
+
WideBible provides 31,102 verses across 4 English translations. Each verse includes the original text, reference notation, and chapter/book context. The KJV (King James Version, 1611) is the default translation.
|
|
89
|
+
|
|
90
|
+
| Translation | Code | Year | Style |
|
|
91
|
+
|-------------|------|------|-------|
|
|
92
|
+
| King James Version | `kjv` | 1611 | Formal equivalence |
|
|
93
|
+
| American Standard Version | `asv` | 1901 | Literal |
|
|
94
|
+
| Bible in Basic English | `bbe` | 1965 | Simplified vocabulary |
|
|
95
|
+
| Young's Literal Translation | `ylt` | 1862 | Ultra-literal |
|
|
96
|
+
|
|
97
|
+
```ruby
|
|
98
|
+
# Get John 3:16 in KJV (default)
|
|
99
|
+
verse = client.get_verse("john", 3, 16)
|
|
100
|
+
|
|
101
|
+
# Get Genesis 1:1 in ASV translation
|
|
102
|
+
verse = client.get_verse("genesis", 1, 1, translation: "asv")
|
|
103
|
+
|
|
104
|
+
# List chapters in a book
|
|
105
|
+
chapters = client.list_chapters(book: "psalms")
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Search Scripture
|
|
109
|
+
|
|
110
|
+
Full-text search across all Bible verses with relevance ranking.
|
|
111
|
+
|
|
112
|
+
```ruby
|
|
113
|
+
# Search for verses about love
|
|
114
|
+
results = client.search("love", limit: 10)
|
|
115
|
+
results["results"].each do |verse|
|
|
116
|
+
puts "#{verse["reference"]}: #{verse["text"]}"
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Search for creation passages
|
|
120
|
+
results = client.search("In the beginning God created")
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Explore Biblical People
|
|
124
|
+
|
|
125
|
+
Biographical profiles of prophets, kings, apostles, and other key figures mentioned in the Bible, with their roles, relationships, and associated scripture references.
|
|
126
|
+
|
|
127
|
+
```ruby
|
|
128
|
+
# List all biblical people
|
|
129
|
+
people = client.list_people
|
|
130
|
+
|
|
131
|
+
# Get details for a specific person
|
|
132
|
+
moses = client.get_person("moses")
|
|
133
|
+
puts moses["name"] # => "Moses"
|
|
134
|
+
puts moses["description"] # Biography and significance
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Discover Holy Places
|
|
138
|
+
|
|
139
|
+
Geocoded biblical locations with historical context, archaeological notes, and scripture references. From the Garden of Eden to first-century Jerusalem.
|
|
140
|
+
|
|
141
|
+
```ruby
|
|
142
|
+
# List biblical places
|
|
143
|
+
places = client.list_places
|
|
144
|
+
|
|
145
|
+
# Get details for a specific place
|
|
146
|
+
jerusalem = client.get_place("jerusalem")
|
|
147
|
+
puts jerusalem["name"]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Follow Cross-References
|
|
151
|
+
|
|
152
|
+
Cross-references connect related passages across the Bible, revealing thematic links between Old and New Testament texts.
|
|
153
|
+
|
|
154
|
+
```ruby
|
|
155
|
+
# List cross-references
|
|
156
|
+
refs = client.list_cross_references
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Study Glossary Terms
|
|
160
|
+
|
|
161
|
+
Biblical glossary with Hebrew and Greek original words, transliterations, and theological definitions.
|
|
162
|
+
|
|
163
|
+
```ruby
|
|
164
|
+
# Browse glossary terms
|
|
165
|
+
terms = client.list_glossary
|
|
166
|
+
|
|
167
|
+
# Look up a specific term
|
|
168
|
+
term = client.get_glossary_term("agape")
|
|
169
|
+
puts term["definition"]
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Walk the Timeline
|
|
173
|
+
|
|
174
|
+
Biblical chronology organized into eras -- from Creation through the Patriarchs, Exodus, Monarchy, Exile, and into the New Testament period.
|
|
175
|
+
|
|
176
|
+
```ruby
|
|
177
|
+
# List timeline eras
|
|
178
|
+
eras = client.list_eras
|
|
179
|
+
|
|
180
|
+
# List events in a specific era
|
|
181
|
+
events = client.list_events(era: "patriarchs")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Follow Reading Plans
|
|
185
|
+
|
|
186
|
+
Structured Bible reading plans for systematic study -- daily readings organized into multi-week programs covering different themes or the entire Bible.
|
|
187
|
+
|
|
188
|
+
```ruby
|
|
189
|
+
# List available reading plans
|
|
190
|
+
plans = client.list_reading_plans
|
|
191
|
+
|
|
192
|
+
# Get a specific plan with daily entries
|
|
193
|
+
plan = client.get_reading_plan("bible-in-a-year")
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## API Reference
|
|
197
|
+
|
|
198
|
+
| Method | Description |
|
|
199
|
+
|--------|-------------|
|
|
200
|
+
| `list_books` | List all 66 Bible books |
|
|
201
|
+
| `get_book(slug)` | Get book details by slug |
|
|
202
|
+
| `list_book_groups` | List book groups (Pentateuch, Gospels, etc.) |
|
|
203
|
+
| `get_book_group(slug)` | Get book group details |
|
|
204
|
+
| `list_translations` | List available translations |
|
|
205
|
+
| `get_translation(code)` | Get translation by code |
|
|
206
|
+
| `list_chapters(book:)` | List chapters, filter by book |
|
|
207
|
+
| `get_verse(book, chapter, verse, translation:)` | Get a specific verse |
|
|
208
|
+
| `search(query, limit:)` | Search verses by keyword |
|
|
209
|
+
| `list_people` | List biblical people |
|
|
210
|
+
| `get_person(slug)` | Get person details |
|
|
211
|
+
| `list_places` | List biblical places |
|
|
212
|
+
| `get_place(slug)` | Get place details |
|
|
213
|
+
| `list_topics` | List thematic topics |
|
|
214
|
+
| `get_topic(slug)` | Get topic with verses |
|
|
215
|
+
| `list_cross_references` | List cross-references |
|
|
216
|
+
| `list_glossary` | List glossary terms |
|
|
217
|
+
| `get_glossary_term(slug)` | Get glossary term definition |
|
|
218
|
+
| `list_eras` | List timeline eras |
|
|
219
|
+
| `list_events(era:)` | List timeline events |
|
|
220
|
+
| `list_reading_plans` | List reading plans |
|
|
221
|
+
| `get_reading_plan(slug)` | Get reading plan details |
|
|
222
|
+
|
|
223
|
+
## Learn More About the Bible
|
|
224
|
+
|
|
225
|
+
- **Browse**: [Books of the Bible](https://widebible.com/books/) -- [People](https://widebible.com/people/) -- [Places](https://widebible.com/places/)
|
|
226
|
+
- **Study**: [Topics](https://widebible.com/topics/) -- [Glossary](https://widebible.com/glossary/) -- [Timeline](https://widebible.com/timeline/)
|
|
227
|
+
- **API**: [REST API Docs](https://widebible.com/developers/) -- [OpenAPI Spec](https://widebible.com/api/openapi.json)
|
|
228
|
+
|
|
229
|
+
## WideHoly Scripture Family
|
|
230
|
+
|
|
231
|
+
Part of the [WideHoly](https://wideholy.com) multi-religion scripture platform.
|
|
232
|
+
|
|
233
|
+
| Site | Domain | Focus |
|
|
234
|
+
|------|--------|-------|
|
|
235
|
+
| **WideBible** | [widebible.com](https://widebible.com) | **66 books, 31,102 verses, KJV/ASV/BBE/YLT, cross-references** |
|
|
236
|
+
| WideQuran | [widequran.com](https://widequran.com) | 114 surahs, 6,236 ayahs, hadith collections, tafsir |
|
|
237
|
+
| WideTorah | [widetorah.com](https://widetorah.com) | Tanakh, Talmud tractates, parashot, Rashi commentary |
|
|
238
|
+
| WideGita | [widegita.com](https://widegita.com) | 18 chapters, 700 verses, Upanishads, Yoga Sutras |
|
|
239
|
+
| WideSutra | [widesutra.com](https://widesutra.com) | Tipitaka, Pali Canon, Mahayana sutras, Buddhist figures |
|
|
240
|
+
| WideHoly | [wideholy.com](https://wideholy.com) | Cross-religion search, verse comparison, shared topics |
|
|
241
|
+
|
|
242
|
+
## Also Available
|
|
243
|
+
|
|
244
|
+
| Platform | Install | Link |
|
|
245
|
+
|----------|---------|------|
|
|
246
|
+
| **PyPI** | `pip install widebible` | [PyPI](https://pypi.org/project/widebible/) |
|
|
247
|
+
| **npm** | `npm install widebible` | [npm](https://www.npmjs.com/package/widebible) |
|
|
248
|
+
|
|
249
|
+
## License
|
|
250
|
+
|
|
251
|
+
MIT
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "json"
|
|
5
|
+
require "uri"
|
|
6
|
+
|
|
7
|
+
module WideBible
|
|
8
|
+
# HTTP client for the WideBible REST API.
|
|
9
|
+
#
|
|
10
|
+
# Zero runtime dependencies -- uses only Ruby stdlib (net/http, json, uri).
|
|
11
|
+
#
|
|
12
|
+
# client = WideBible::Client.new
|
|
13
|
+
# books = client.list_books
|
|
14
|
+
# verse = client.get_verse("john", 3, 16)
|
|
15
|
+
# results = client.search("love")
|
|
16
|
+
#
|
|
17
|
+
class Client
|
|
18
|
+
DEFAULT_BASE_URL = "https://widebible.com/api/v1/bible"
|
|
19
|
+
DEFAULT_TIMEOUT = 10
|
|
20
|
+
|
|
21
|
+
def initialize(base_url: DEFAULT_BASE_URL, timeout: DEFAULT_TIMEOUT)
|
|
22
|
+
@base_url = base_url.chomp("/")
|
|
23
|
+
@timeout = timeout
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# --- Books ----------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
# List all 66 books of the Bible.
|
|
29
|
+
#
|
|
30
|
+
# @return [Hash] paginated list of books
|
|
31
|
+
def list_books(**params)
|
|
32
|
+
get("/books/", params)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Get book details by slug (e.g. "genesis", "john").
|
|
36
|
+
#
|
|
37
|
+
# @param slug [String] book URL slug
|
|
38
|
+
# @return [Hash] book details
|
|
39
|
+
def get_book(slug)
|
|
40
|
+
get("/books/#{slug}/")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# --- Book Groups ----------------------------------------------------------
|
|
44
|
+
|
|
45
|
+
# List book groups (Pentateuch, Gospels, etc.).
|
|
46
|
+
#
|
|
47
|
+
# @return [Hash] paginated list of book groups
|
|
48
|
+
def list_book_groups(**params)
|
|
49
|
+
get("/book-groups/", params)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Get book group details by slug.
|
|
53
|
+
#
|
|
54
|
+
# @param slug [String] book group slug
|
|
55
|
+
# @return [Hash] book group details
|
|
56
|
+
def get_book_group(slug)
|
|
57
|
+
get("/book-groups/#{slug}/")
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# --- Translations ---------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
# List available Bible translations (KJV, ASV, BBE, YLT).
|
|
63
|
+
#
|
|
64
|
+
# @return [Hash] paginated list of translations
|
|
65
|
+
def list_translations(**params)
|
|
66
|
+
get("/translations/", params)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Get translation details by code (e.g. "kjv").
|
|
70
|
+
#
|
|
71
|
+
# @param code [String] translation code
|
|
72
|
+
# @return [Hash] translation details
|
|
73
|
+
def get_translation(code)
|
|
74
|
+
get("/translations/#{code}/")
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# --- Chapters -------------------------------------------------------------
|
|
78
|
+
|
|
79
|
+
# List chapters, optionally filtered by book slug.
|
|
80
|
+
#
|
|
81
|
+
# @param book [String, nil] book slug to filter by
|
|
82
|
+
# @return [Hash] paginated list of chapters
|
|
83
|
+
def list_chapters(book: nil, **params)
|
|
84
|
+
get("/chapters/", { book__slug: book }.merge(params))
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# --- Verses ---------------------------------------------------------------
|
|
88
|
+
|
|
89
|
+
# Get a specific Bible verse by book, chapter, and verse number.
|
|
90
|
+
#
|
|
91
|
+
# @param book [String] book slug (e.g. "john", "genesis")
|
|
92
|
+
# @param chapter [Integer] chapter number
|
|
93
|
+
# @param verse [Integer] verse number
|
|
94
|
+
# @param translation [String] translation code (default: "kjv")
|
|
95
|
+
# @return [Hash] verse data with text, reference, and translation
|
|
96
|
+
def get_verse(book, chapter, verse, translation: "kjv")
|
|
97
|
+
get("/verses/", {
|
|
98
|
+
book__slug: book,
|
|
99
|
+
chapter: chapter,
|
|
100
|
+
verse: verse,
|
|
101
|
+
translation__code: translation
|
|
102
|
+
})
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Search Bible verses by keyword.
|
|
106
|
+
#
|
|
107
|
+
# @param query [String] search query string
|
|
108
|
+
# @param limit [Integer] maximum number of results (default: 25)
|
|
109
|
+
# @return [Hash] paginated search results
|
|
110
|
+
def search(query, limit: 25)
|
|
111
|
+
get("/verses/", { search: query, page_size: limit })
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# --- People ---------------------------------------------------------------
|
|
115
|
+
|
|
116
|
+
# List biblical people (prophets, kings, apostles, etc.).
|
|
117
|
+
#
|
|
118
|
+
# @return [Hash] paginated list of people
|
|
119
|
+
def list_people(**params)
|
|
120
|
+
get("/people/", params)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Get a biblical person's details by slug.
|
|
124
|
+
#
|
|
125
|
+
# @param slug [String] person slug
|
|
126
|
+
# @return [Hash] person details
|
|
127
|
+
def get_person(slug)
|
|
128
|
+
get("/people/#{slug}/")
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# --- Places ---------------------------------------------------------------
|
|
132
|
+
|
|
133
|
+
# List biblical places with geocoded coordinates.
|
|
134
|
+
#
|
|
135
|
+
# @return [Hash] paginated list of places
|
|
136
|
+
def list_places(**params)
|
|
137
|
+
get("/places/", params)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Get a biblical place's details by slug.
|
|
141
|
+
#
|
|
142
|
+
# @param slug [String] place slug
|
|
143
|
+
# @return [Hash] place details
|
|
144
|
+
def get_place(slug)
|
|
145
|
+
get("/places/#{slug}/")
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# --- Topics ---------------------------------------------------------------
|
|
149
|
+
|
|
150
|
+
# List thematic verse collections (love, faith, prayer, etc.).
|
|
151
|
+
#
|
|
152
|
+
# @return [Hash] paginated list of topics
|
|
153
|
+
def list_topics(**params)
|
|
154
|
+
get("/topics/", params)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Get topic details and associated verses by slug.
|
|
158
|
+
#
|
|
159
|
+
# @param slug [String] topic slug
|
|
160
|
+
# @return [Hash] topic details with verses
|
|
161
|
+
def get_topic(slug)
|
|
162
|
+
get("/topics/#{slug}/")
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# --- Cross-References -----------------------------------------------------
|
|
166
|
+
|
|
167
|
+
# List cross-references between Bible passages.
|
|
168
|
+
#
|
|
169
|
+
# @return [Hash] paginated list of cross-references
|
|
170
|
+
def list_cross_references(**params)
|
|
171
|
+
get("/cross-references/", params)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# --- Glossary -------------------------------------------------------------
|
|
175
|
+
|
|
176
|
+
# List biblical glossary terms with Hebrew/Greek words.
|
|
177
|
+
#
|
|
178
|
+
# @return [Hash] paginated list of glossary terms
|
|
179
|
+
def list_glossary(**params)
|
|
180
|
+
get("/glossary/", params)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Get a glossary term's definition by slug.
|
|
184
|
+
#
|
|
185
|
+
# @param slug [String] glossary term slug
|
|
186
|
+
# @return [Hash] glossary term details
|
|
187
|
+
def get_glossary_term(slug)
|
|
188
|
+
get("/glossary/#{slug}/")
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# --- Timeline -------------------------------------------------------------
|
|
192
|
+
|
|
193
|
+
# List biblical timeline eras (Patriarchs, Exodus, etc.).
|
|
194
|
+
#
|
|
195
|
+
# @return [Hash] paginated list of eras
|
|
196
|
+
def list_eras(**params)
|
|
197
|
+
get("/timeline-eras/", params)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# List timeline events, optionally filtered by era slug.
|
|
201
|
+
#
|
|
202
|
+
# @param era [String, nil] era slug to filter by
|
|
203
|
+
# @return [Hash] paginated list of events
|
|
204
|
+
def list_events(era: nil, **params)
|
|
205
|
+
get("/timeline-events/", { era__slug: era }.merge(params))
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# --- Reading Plans --------------------------------------------------------
|
|
209
|
+
|
|
210
|
+
# List Bible reading plans.
|
|
211
|
+
#
|
|
212
|
+
# @return [Hash] paginated list of reading plans
|
|
213
|
+
def list_reading_plans(**params)
|
|
214
|
+
get("/reading-plans/", params)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Get a reading plan's details and daily entries by slug.
|
|
218
|
+
#
|
|
219
|
+
# @param slug [String] reading plan slug
|
|
220
|
+
# @return [Hash] reading plan details
|
|
221
|
+
def get_reading_plan(slug)
|
|
222
|
+
get("/reading-plans/#{slug}/")
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
private
|
|
226
|
+
|
|
227
|
+
def get(path, params = {})
|
|
228
|
+
uri = URI("#{@base_url}#{path}")
|
|
229
|
+
cleaned = params.each_with_object({}) { |(k, v), h| h[k] = v unless v.nil? }
|
|
230
|
+
uri.query = URI.encode_www_form(cleaned) unless cleaned.empty?
|
|
231
|
+
|
|
232
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
233
|
+
http.use_ssl = uri.scheme == "https"
|
|
234
|
+
http.open_timeout = @timeout
|
|
235
|
+
http.read_timeout = @timeout
|
|
236
|
+
|
|
237
|
+
request = Net::HTTP::Get.new(uri)
|
|
238
|
+
request["Accept"] = "application/json"
|
|
239
|
+
request["User-Agent"] = "widebible-rb/#{VERSION}"
|
|
240
|
+
|
|
241
|
+
response = http.request(request)
|
|
242
|
+
|
|
243
|
+
case response
|
|
244
|
+
when Net::HTTPSuccess
|
|
245
|
+
JSON.parse(response.body)
|
|
246
|
+
when Net::HTTPNotFound
|
|
247
|
+
raise "Not found: #{path}"
|
|
248
|
+
else
|
|
249
|
+
raise "HTTP #{response.code}: #{response.body}"
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
end
|
data/lib/widebible.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: widebible
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- dobestan
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-03-24 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: API client for widebible.com. Access 66 books, 31,102 verses across 4
|
|
14
|
+
translations (KJV, ASV, BBE, YLT), biblical people, places, topics, cross-references,
|
|
15
|
+
glossary, timeline, and reading plans. Zero dependencies.
|
|
16
|
+
email:
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- LICENSE
|
|
22
|
+
- README.md
|
|
23
|
+
- lib/widebible.rb
|
|
24
|
+
- lib/widebible/client.rb
|
|
25
|
+
- lib/widebible/version.rb
|
|
26
|
+
homepage: https://widebible.com
|
|
27
|
+
licenses:
|
|
28
|
+
- MIT
|
|
29
|
+
metadata:
|
|
30
|
+
homepage_uri: https://widebible.com
|
|
31
|
+
source_code_uri: https://github.com/dobestan/widebible-rb
|
|
32
|
+
changelog_uri: https://github.com/dobestan/widebible-rb/blob/main/CHANGELOG.md
|
|
33
|
+
documentation_uri: https://widebible.com/developers/
|
|
34
|
+
bug_tracker_uri: https://github.com/dobestan/widebible-rb/issues
|
|
35
|
+
post_install_message:
|
|
36
|
+
rdoc_options: []
|
|
37
|
+
require_paths:
|
|
38
|
+
- lib
|
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '3.0'
|
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
|
+
requirements:
|
|
46
|
+
- - ">="
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: '0'
|
|
49
|
+
requirements: []
|
|
50
|
+
rubygems_version: 3.0.3.1
|
|
51
|
+
signing_key:
|
|
52
|
+
specification_version: 4
|
|
53
|
+
summary: Ruby SDK for WideBible — Bible verses, people, places, cross-references
|
|
54
|
+
test_files: []
|