wideholy 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 +224 -0
- data/lib/wideholy/client.rb +151 -0
- data/lib/wideholy/version.rb +5 -0
- data/lib/wideholy.rb +4 -0
- metadata +54 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 5e1eeabe5d87f51d1a6b7e9ba708f2dd03cb484d7649cf7e278e27fda65ece35
|
|
4
|
+
data.tar.gz: f1f2ccaf8cd30f6573fc246edace4ad5e5540374aed2bc29e45ec0c87702b07d
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 79cf6ac1fb33e538a22350d6ac0afacb5bf741f77536bae52d22554ba8ac48bc1aea710148297caba383098c8dd48b0f081fefd3f97aaf91c70eba5efaec4dca
|
|
7
|
+
data.tar.gz: ef04078ac338c50ac3e567d0a66b385dd6586f7576a5d5d5637f9aa55c05b7bc0065ff5129ca4affbef5d1d3ad8e354ca9dee5a280b862b76c7c1e0dad67c1b8
|
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,224 @@
|
|
|
1
|
+
# wideholy
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/wideholy)
|
|
4
|
+
[](https://www.ruby-lang.org/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://rubygems.org/gems/wideholy)
|
|
7
|
+
|
|
8
|
+
Ruby client for the [WideHoly](https://wideholy.com) hub API. Cross-religion scripture search and comparison across 5 world religions -- Bible, Quran, Torah, Bhagavad Gita, and Buddhist Sutras. Features verse of the day, random verse, side-by-side verse comparison, search suggestions, topic verses, religious calendar events, and commentary lookup. Zero runtime dependencies -- uses only Ruby stdlib (`net/http`, `json`, `uri`).
|
|
9
|
+
|
|
10
|
+
WideHoly is the unified hub connecting 5 scripture platforms into a single cross-religion search and comparison engine, enabling interfaith study and thematic exploration across traditions.
|
|
11
|
+
|
|
12
|
+
> **Explore world scriptures at [wideholy.com](https://wideholy.com)** -- [Bible](https://widebible.com), [Quran](https://widequran.com), [Torah](https://widetorah.com), [Gita](https://widegita.com), [Sutra](https://widesutra.com)
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Install](#install)
|
|
17
|
+
- [Quick Start](#quick-start)
|
|
18
|
+
- [What You Can Do](#what-you-can-do)
|
|
19
|
+
- [Get Verse of the Day](#get-verse-of-the-day)
|
|
20
|
+
- [Get a Random Verse](#get-a-random-verse)
|
|
21
|
+
- [Compare Verses Across Religions](#compare-verses-across-religions)
|
|
22
|
+
- [Search Across All Scriptures](#search-across-all-scriptures)
|
|
23
|
+
- [Explore Topics Across Religions](#explore-topics-across-religions)
|
|
24
|
+
- [Browse Religious Calendar](#browse-religious-calendar)
|
|
25
|
+
- [Read Commentary](#read-commentary)
|
|
26
|
+
- [API Reference](#api-reference)
|
|
27
|
+
- [Supported Religions](#supported-religions)
|
|
28
|
+
- [Learn More About World Scriptures](#learn-more-about-world-scriptures)
|
|
29
|
+
- [WideHoly Scripture Family](#wideholy-scripture-family)
|
|
30
|
+
- [Also Available](#also-available)
|
|
31
|
+
- [License](#license)
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
gem install wideholy
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or add to your Gemfile:
|
|
40
|
+
|
|
41
|
+
```ruby
|
|
42
|
+
gem "wideholy"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quick Start
|
|
46
|
+
|
|
47
|
+
```ruby
|
|
48
|
+
require "wideholy"
|
|
49
|
+
|
|
50
|
+
# Create a client (zero configuration needed)
|
|
51
|
+
client = WideHoly::Client.new
|
|
52
|
+
|
|
53
|
+
# Get today's verse of the day from the Bible
|
|
54
|
+
votd = client.verse_of_the_day("bible")
|
|
55
|
+
puts votd["text"]
|
|
56
|
+
|
|
57
|
+
# Compare verses across religions
|
|
58
|
+
result = client.compare("bible:genesis.1.1", "quran:al-fatihah.1")
|
|
59
|
+
puts result["verse_a"]["text"]
|
|
60
|
+
puts result["verse_b"]["text"]
|
|
61
|
+
|
|
62
|
+
# Search across all scriptures
|
|
63
|
+
suggestions = client.search_suggest("love")
|
|
64
|
+
suggestions["suggestions"].each { |s| puts "#{s["religion"]}: #{s["text"]}" }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## What You Can Do
|
|
68
|
+
|
|
69
|
+
### Get Verse of the Day
|
|
70
|
+
|
|
71
|
+
A curated daily verse from any of the 5 supported religions. Deterministic per religion per date -- the same verse is returned for the same religion and date combination.
|
|
72
|
+
|
|
73
|
+
```ruby
|
|
74
|
+
# Bible verse of the day
|
|
75
|
+
votd = client.verse_of_the_day("bible")
|
|
76
|
+
puts votd["reference"] # => "John 3:16"
|
|
77
|
+
puts votd["text"]
|
|
78
|
+
|
|
79
|
+
# Quran verse of the day
|
|
80
|
+
votd = client.verse_of_the_day("quran")
|
|
81
|
+
|
|
82
|
+
# Get a specific date's verse
|
|
83
|
+
votd = client.verse_of_the_day("torah", date: "2026-03-24")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Get a Random Verse
|
|
87
|
+
|
|
88
|
+
A randomly selected verse from any or all religions -- useful for daily inspiration or interfaith discovery.
|
|
89
|
+
|
|
90
|
+
```ruby
|
|
91
|
+
# Random verse from any religion
|
|
92
|
+
verse = client.random_verse
|
|
93
|
+
puts "#{verse["religion"]}: #{verse["text"]}"
|
|
94
|
+
|
|
95
|
+
# Random verse from a specific religion
|
|
96
|
+
verse = client.random_verse(religion: "gita")
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Compare Verses Across Religions
|
|
100
|
+
|
|
101
|
+
Side-by-side comparison of two verses -- from the same scripture or across different religions. Use the `religion:reference` format for cross-religion references.
|
|
102
|
+
|
|
103
|
+
```ruby
|
|
104
|
+
# Cross-religion comparison: Genesis 1:1 vs Al-Fatihah 1
|
|
105
|
+
result = client.compare("bible:genesis.1.1", "quran:al-fatihah.1")
|
|
106
|
+
puts result["verse_a"]["text"]
|
|
107
|
+
puts result["verse_b"]["text"]
|
|
108
|
+
puts result["same_religion"] # => false
|
|
109
|
+
|
|
110
|
+
# Same-religion comparison
|
|
111
|
+
result = client.compare("bible:genesis.1.1", "bible:john.1.1")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Search Across All Scriptures
|
|
115
|
+
|
|
116
|
+
Autocomplete suggestions that span all 5 religions -- returning matching topics, people, and glossary terms.
|
|
117
|
+
|
|
118
|
+
```ruby
|
|
119
|
+
# Search suggestions across all religions
|
|
120
|
+
suggestions = client.search_suggest("creation")
|
|
121
|
+
suggestions["suggestions"].each do |s|
|
|
122
|
+
puts "#{s["type"]} (#{s["religion"]}): #{s["text"]}"
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Filter to a specific religion
|
|
126
|
+
suggestions = client.search_suggest("mercy", religion: "quran")
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Explore Topics Across Religions
|
|
130
|
+
|
|
131
|
+
Universal spiritual themes -- love, creation, prayer, compassion, justice -- with relevant verses from each religion that addresses the topic.
|
|
132
|
+
|
|
133
|
+
```ruby
|
|
134
|
+
# Get verses about "love" from all religions
|
|
135
|
+
love = client.topic_verses("love")
|
|
136
|
+
puts "Found in #{love["religions_found"]} religions"
|
|
137
|
+
|
|
138
|
+
# Cross-religion analysis of a theme
|
|
139
|
+
creation = client.cross_religion("creation")
|
|
140
|
+
creation["religions"].each do |r|
|
|
141
|
+
puts "#{r["religion"]}: #{r["summary"]}"
|
|
142
|
+
end
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Browse Religious Calendar
|
|
146
|
+
|
|
147
|
+
Religious holidays and observances across traditions -- Easter, Ramadan, Passover, Diwali, Vesak -- with dates and descriptions.
|
|
148
|
+
|
|
149
|
+
```ruby
|
|
150
|
+
# Get all religious events for March 2026
|
|
151
|
+
events = client.calendar(year: 2026, month: 3)
|
|
152
|
+
events["events"].each do |e|
|
|
153
|
+
puts "#{e["date"]}: #{e["name"]} (#{e["religion"]})"
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Filter to a specific religion
|
|
157
|
+
islamic = client.calendar(religion: "quran", year: 2026)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Read Commentary
|
|
161
|
+
|
|
162
|
+
Scholarly commentary for verses across traditions -- Quran tafsir (Ibn Kathir), Torah commentary (Rashi), and Gita commentaries (Shankaracharya).
|
|
163
|
+
|
|
164
|
+
```ruby
|
|
165
|
+
# Get tafsir for a Quran verse
|
|
166
|
+
commentary = client.commentary("quran:al-fatihah.1")
|
|
167
|
+
commentary["commentaries"].each do |c|
|
|
168
|
+
puts "#{c["author"]}: #{c["text"]}"
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Get Rashi commentary for a Torah verse
|
|
172
|
+
commentary = client.commentary("torah:genesis.1.1")
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## API Reference
|
|
176
|
+
|
|
177
|
+
| Method | Description |
|
|
178
|
+
|--------|-------------|
|
|
179
|
+
| `verse_of_the_day(religion, date:)` | Daily curated verse per religion |
|
|
180
|
+
| `random_verse(religion:)` | Random verse from any/all religions |
|
|
181
|
+
| `compare(ref_a, ref_b)` | Side-by-side verse comparison |
|
|
182
|
+
| `search_suggest(query, religion:)` | Autocomplete across religions |
|
|
183
|
+
| `topic_verses(topic)` | Verses for a topic across religions |
|
|
184
|
+
| `cross_religion(topic)` | Cross-religion theme analysis |
|
|
185
|
+
| `calendar(religion:, year:, month:)` | Religious calendar events |
|
|
186
|
+
| `commentary(verse_ref)` | Scholarly commentary for a verse |
|
|
187
|
+
|
|
188
|
+
## Supported Religions
|
|
189
|
+
|
|
190
|
+
| Key | Religion | Scripture | Site |
|
|
191
|
+
|-----|----------|-----------|------|
|
|
192
|
+
| `bible` | Christianity | Bible (66 books, 31,102 verses) | [widebible.com](https://widebible.com) |
|
|
193
|
+
| `quran` | Islam | Quran (114 surahs, 6,236 ayahs) | [widequran.com](https://widequran.com) |
|
|
194
|
+
| `torah` | Judaism | Tanakh (24 books) + Talmud | [widetorah.com](https://widetorah.com) |
|
|
195
|
+
| `gita` | Hinduism | Bhagavad Gita (18 chapters, 700 verses) | [widegita.com](https://widegita.com) |
|
|
196
|
+
| `sutra` | Buddhism | Tipitaka + Mahayana Sutras | [widesutra.com](https://widesutra.com) |
|
|
197
|
+
|
|
198
|
+
## Learn More About World Scriptures
|
|
199
|
+
|
|
200
|
+
- **Compare**: [Cross-Religion Topics](https://wideholy.com/topics/) -- [Verse Comparison](https://wideholy.com/compare/)
|
|
201
|
+
- **Explore**: [Religious Calendar](https://wideholy.com/calendar/) -- [Commentary](https://wideholy.com/commentary/)
|
|
202
|
+
- **API**: [REST API Docs](https://wideholy.com/developers/) -- [OpenAPI Spec](https://wideholy.com/api/openapi.json)
|
|
203
|
+
|
|
204
|
+
## WideHoly Scripture Family
|
|
205
|
+
|
|
206
|
+
| Site | Domain | Focus |
|
|
207
|
+
|------|--------|-------|
|
|
208
|
+
| WideBible | [widebible.com](https://widebible.com) | 66 books, 31,102 verses, KJV/ASV/BBE/YLT, cross-references |
|
|
209
|
+
| WideQuran | [widequran.com](https://widequran.com) | 114 surahs, 6,236 ayahs, hadith collections, tafsir |
|
|
210
|
+
| WideTorah | [widetorah.com](https://widetorah.com) | Tanakh, Talmud tractates, parashot, Rashi commentary |
|
|
211
|
+
| WideGita | [widegita.com](https://widegita.com) | 18 chapters, 700 verses, Upanishads, Yoga Sutras |
|
|
212
|
+
| WideSutra | [widesutra.com](https://widesutra.com) | Tipitaka, Pali Canon, Mahayana sutras, Buddhist figures |
|
|
213
|
+
| **WideHoly** | [wideholy.com](https://wideholy.com) | **Cross-religion search, verse comparison, shared topics** |
|
|
214
|
+
|
|
215
|
+
## Also Available
|
|
216
|
+
|
|
217
|
+
| Platform | Install | Link |
|
|
218
|
+
|----------|---------|------|
|
|
219
|
+
| **PyPI** | `pip install wideholy` | [PyPI](https://pypi.org/project/wideholy/) |
|
|
220
|
+
| **npm** | `npm install wideholy` | [npm](https://www.npmjs.com/package/wideholy) |
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
MIT
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "json"
|
|
5
|
+
require "uri"
|
|
6
|
+
|
|
7
|
+
module WideHoly
|
|
8
|
+
# HTTP client for the WideHoly hub REST API.
|
|
9
|
+
#
|
|
10
|
+
# Cross-religion scripture search and comparison across Bible, Quran,
|
|
11
|
+
# Torah, Gita, and Buddhist sutras.
|
|
12
|
+
#
|
|
13
|
+
# Zero runtime dependencies -- uses only Ruby stdlib (net/http, json, uri).
|
|
14
|
+
#
|
|
15
|
+
# client = WideHoly::Client.new
|
|
16
|
+
# votd = client.verse_of_the_day("bible")
|
|
17
|
+
# result = client.compare("bible:genesis.1.1", "quran:al-fatihah.1")
|
|
18
|
+
#
|
|
19
|
+
class Client
|
|
20
|
+
DEFAULT_BASE_URL = "https://wideholy.com/api/v1"
|
|
21
|
+
DEFAULT_TIMEOUT = 10
|
|
22
|
+
|
|
23
|
+
VALID_RELIGIONS = %w[bible quran torah gita sutra].freeze
|
|
24
|
+
|
|
25
|
+
def initialize(base_url: DEFAULT_BASE_URL, timeout: DEFAULT_TIMEOUT)
|
|
26
|
+
@base_url = base_url.chomp("/")
|
|
27
|
+
@timeout = timeout
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# --- Verse of the Day -----------------------------------------------------
|
|
31
|
+
|
|
32
|
+
# Get the verse of the day for a religion.
|
|
33
|
+
#
|
|
34
|
+
# Returns a curated verse, deterministic per religion per date.
|
|
35
|
+
#
|
|
36
|
+
# @param religion [String] religion key (bible, quran, torah, gita, sutra)
|
|
37
|
+
# @param date [String, nil] date in YYYY-MM-DD format (defaults to today)
|
|
38
|
+
# @return [Hash] verse with reference, text, translation, book, chapter, verse, date
|
|
39
|
+
def verse_of_the_day(religion = "bible", date: nil)
|
|
40
|
+
get("/verse-of-the-day/", { religion: religion, date: date })
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# --- Random Verse ---------------------------------------------------------
|
|
44
|
+
|
|
45
|
+
# Get a random verse, optionally filtered by religion.
|
|
46
|
+
#
|
|
47
|
+
# @param religion [String, nil] religion key; if nil, picks a random religion
|
|
48
|
+
# @return [Hash] verse with religion, reference, text, translation
|
|
49
|
+
def random_verse(religion: nil)
|
|
50
|
+
get("/random/", { religion: religion })
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# --- Compare Verses -------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
# Compare two verses side-by-side (same or cross-religion).
|
|
56
|
+
#
|
|
57
|
+
# Use "religion:ref" format for cross-religion comparison.
|
|
58
|
+
#
|
|
59
|
+
# @param ref_a [String] first verse reference (e.g. "bible:genesis.1.1")
|
|
60
|
+
# @param ref_b [String] second verse reference (e.g. "quran:al-fatihah.1")
|
|
61
|
+
# @return [Hash] comparison with verse_a, verse_b, same_religion
|
|
62
|
+
def compare(ref_a, ref_b)
|
|
63
|
+
get("/compare/", { a: ref_a, b: ref_b })
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# --- Search Suggest -------------------------------------------------------
|
|
67
|
+
|
|
68
|
+
# Autocomplete suggestions across religions.
|
|
69
|
+
#
|
|
70
|
+
# Returns topic, person, and glossary term suggestions matching the query.
|
|
71
|
+
#
|
|
72
|
+
# @param query [String] search query prefix (minimum 2 characters)
|
|
73
|
+
# @param religion [String, nil] filter to a specific religion
|
|
74
|
+
# @return [Hash] suggestions list (text, type, religion, url)
|
|
75
|
+
def search_suggest(query, religion: nil)
|
|
76
|
+
get("/search/suggest/", { q: query, religion: religion })
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# --- Topic Verses ---------------------------------------------------------
|
|
80
|
+
|
|
81
|
+
# Get verses for a topic across all religions.
|
|
82
|
+
#
|
|
83
|
+
# @param topic [String] topic slug (e.g. "love", "creation", "prayer")
|
|
84
|
+
# @return [Hash] topic with religions_found, verses (per-religion data)
|
|
85
|
+
def topic_verses(topic)
|
|
86
|
+
get("/topics/#{topic}/verses/")
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# --- Cross-Religion Topic -------------------------------------------------
|
|
90
|
+
|
|
91
|
+
# Get cross-religion comparison for a universal spiritual theme.
|
|
92
|
+
#
|
|
93
|
+
# @param topic [String] topic key (e.g. "creation", "prayer", "love")
|
|
94
|
+
# @return [Hash] topic with title, summary, religions (per-religion data)
|
|
95
|
+
def cross_religion(topic)
|
|
96
|
+
get("/cross-religion/#{topic}/")
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# --- Religious Calendar ---------------------------------------------------
|
|
100
|
+
|
|
101
|
+
# Get religious calendar events.
|
|
102
|
+
#
|
|
103
|
+
# @param religion [String, nil] filter by religion key
|
|
104
|
+
# @param year [Integer, nil] year (default: current year)
|
|
105
|
+
# @param month [Integer, nil] month number (1-12)
|
|
106
|
+
# @return [Hash] calendar with year, month, religion, events list
|
|
107
|
+
def calendar(religion: nil, year: nil, month: nil)
|
|
108
|
+
get("/calendar/", { religion: religion, year: year, month: month })
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# --- Commentary -----------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
# Get commentary for a verse.
|
|
114
|
+
#
|
|
115
|
+
# Supports Quran (tafsir), Torah (Rashi), and Gita commentaries.
|
|
116
|
+
#
|
|
117
|
+
# @param verse_ref [String] verse reference (e.g. "quran:al-fatihah.1")
|
|
118
|
+
# @return [Hash] commentary with verse_ref, religion, commentaries list
|
|
119
|
+
def commentary(verse_ref)
|
|
120
|
+
get("/commentary/#{verse_ref}/")
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
private
|
|
124
|
+
|
|
125
|
+
def get(path, params = {})
|
|
126
|
+
uri = URI("#{@base_url}#{path}")
|
|
127
|
+
cleaned = params.each_with_object({}) { |(k, v), h| h[k] = v unless v.nil? }
|
|
128
|
+
uri.query = URI.encode_www_form(cleaned) unless cleaned.empty?
|
|
129
|
+
|
|
130
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
131
|
+
http.use_ssl = uri.scheme == "https"
|
|
132
|
+
http.open_timeout = @timeout
|
|
133
|
+
http.read_timeout = @timeout
|
|
134
|
+
|
|
135
|
+
request = Net::HTTP::Get.new(uri)
|
|
136
|
+
request["Accept"] = "application/json"
|
|
137
|
+
request["User-Agent"] = "wideholy-rb/#{VERSION}"
|
|
138
|
+
|
|
139
|
+
response = http.request(request)
|
|
140
|
+
|
|
141
|
+
case response
|
|
142
|
+
when Net::HTTPSuccess
|
|
143
|
+
JSON.parse(response.body)
|
|
144
|
+
when Net::HTTPNotFound
|
|
145
|
+
raise "Not found: #{path}"
|
|
146
|
+
else
|
|
147
|
+
raise "HTTP #{response.code}: #{response.body}"
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
data/lib/wideholy.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: wideholy
|
|
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 wideholy.com. Cross-religion verse of the day, random
|
|
14
|
+
verse, side-by-side comparison, search suggestions, topic verses across Bible/Quran/Torah/Gita/Sutra,
|
|
15
|
+
religious calendar, and commentary. Zero dependencies.
|
|
16
|
+
email:
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- LICENSE
|
|
22
|
+
- README.md
|
|
23
|
+
- lib/wideholy.rb
|
|
24
|
+
- lib/wideholy/client.rb
|
|
25
|
+
- lib/wideholy/version.rb
|
|
26
|
+
homepage: https://wideholy.com
|
|
27
|
+
licenses:
|
|
28
|
+
- MIT
|
|
29
|
+
metadata:
|
|
30
|
+
homepage_uri: https://wideholy.com
|
|
31
|
+
source_code_uri: https://github.com/dobestan/wideholy-rb
|
|
32
|
+
changelog_uri: https://github.com/dobestan/wideholy-rb/blob/main/CHANGELOG.md
|
|
33
|
+
documentation_uri: https://wideholy.com/developers/
|
|
34
|
+
bug_tracker_uri: https://github.com/dobestan/wideholy-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 WideHoly — cross-religion scripture search and comparison
|
|
54
|
+
test_files: []
|