tldfyi 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/lib/tldfyi.rb +251 -0
- metadata +46 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6102be2980b72dbf92a9a5a3d1184b062e9c368d826a7c2c15d7922c6456b124
|
|
4
|
+
data.tar.gz: b9f37036ce1c2b1c24abd1d8db4115cd252e4e643ad2b87284516eb7dcc16a01
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: a46ade210a44dcf88df9290fe17a5383c733a4e117383bd479ca0e31d1ea55d12b5ba9fe717815aaaad6f9b03acb6c880292244dc633d59857099c1305a6c507
|
|
7
|
+
data.tar.gz: 922c27a73fb1e2ef4888dd633e29d31b64227aa9f4a41315b0b90065a8d7f775f73f9ca08e7ae708969307ee13069bbe09ce90977b299b9f3efa0af79e3b738b
|
data/lib/tldfyi.rb
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "json"
|
|
5
|
+
require "uri"
|
|
6
|
+
|
|
7
|
+
# Ruby client for TLDFYI REST API (tldfyi.com).
|
|
8
|
+
#
|
|
9
|
+
# client = TLDFYI::Client.new
|
|
10
|
+
# result = client.search("query")
|
|
11
|
+
#
|
|
12
|
+
module TLDFYI
|
|
13
|
+
class Client
|
|
14
|
+
BASE_URL = "https://tldfyi.com"
|
|
15
|
+
|
|
16
|
+
def initialize(base_url: BASE_URL)
|
|
17
|
+
@base_url = base_url
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def search(query)
|
|
21
|
+
get("/api/v1/rest/search/", q: query)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# List all brands.
|
|
25
|
+
def list_brands
|
|
26
|
+
get("/api/v1/rest/brands/")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Get brand by slug.
|
|
30
|
+
def get_brand(slug)
|
|
31
|
+
get("/api/v1/rest/brands/#{slug}/")
|
|
32
|
+
end
|
|
33
|
+
# List all collections.
|
|
34
|
+
def list_collections
|
|
35
|
+
get("/api/v1/rest/collections/")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Get collection by slug.
|
|
39
|
+
def get_collection(slug)
|
|
40
|
+
get("/api/v1/rest/collections/#{slug}/")
|
|
41
|
+
end
|
|
42
|
+
# List all comparisons.
|
|
43
|
+
def list_comparisons
|
|
44
|
+
get("/api/v1/rest/comparisons/")
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Get comparison by slug.
|
|
48
|
+
def get_comparison(slug)
|
|
49
|
+
get("/api/v1/rest/comparisons/#{slug}/")
|
|
50
|
+
end
|
|
51
|
+
# List all continents.
|
|
52
|
+
def list_continents
|
|
53
|
+
get("/api/v1/rest/continents/")
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Get continent by slug.
|
|
57
|
+
def get_continent(slug)
|
|
58
|
+
get("/api/v1/rest/continents/#{slug}/")
|
|
59
|
+
end
|
|
60
|
+
# List all countries.
|
|
61
|
+
def list_countries
|
|
62
|
+
get("/api/v1/rest/countries/")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Get country by slug.
|
|
66
|
+
def get_country(slug)
|
|
67
|
+
get("/api/v1/rest/countries/#{slug}/")
|
|
68
|
+
end
|
|
69
|
+
# List all domain hacks.
|
|
70
|
+
def list_domain_hacks
|
|
71
|
+
get("/api/v1/rest/domain-hacks/")
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Get domain hack by slug.
|
|
75
|
+
def get_domain_hack(slug)
|
|
76
|
+
get("/api/v1/rest/domain-hacks/#{slug}/")
|
|
77
|
+
end
|
|
78
|
+
# List all faq categories.
|
|
79
|
+
def list_faq_categories
|
|
80
|
+
get("/api/v1/rest/faq-categories/")
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Get faq category by slug.
|
|
84
|
+
def get_faq_category(slug)
|
|
85
|
+
get("/api/v1/rest/faq-categories/#{slug}/")
|
|
86
|
+
end
|
|
87
|
+
# List all faq entries.
|
|
88
|
+
def list_faq_entries
|
|
89
|
+
get("/api/v1/rest/faq-entries/")
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Get faq entry by slug.
|
|
93
|
+
def get_faq_entry(slug)
|
|
94
|
+
get("/api/v1/rest/faq-entries/#{slug}/")
|
|
95
|
+
end
|
|
96
|
+
# List all faqs.
|
|
97
|
+
def list_faqs
|
|
98
|
+
get("/api/v1/rest/faqs/")
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Get faq by slug.
|
|
102
|
+
def get_faq(slug)
|
|
103
|
+
get("/api/v1/rest/faqs/#{slug}/")
|
|
104
|
+
end
|
|
105
|
+
# List all glossary categories.
|
|
106
|
+
def list_glossary_categories
|
|
107
|
+
get("/api/v1/rest/glossary-categories/")
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Get glossary category by slug.
|
|
111
|
+
def get_glossary_category(slug)
|
|
112
|
+
get("/api/v1/rest/glossary-categories/#{slug}/")
|
|
113
|
+
end
|
|
114
|
+
# List all glossary terms.
|
|
115
|
+
def list_glossary_terms
|
|
116
|
+
get("/api/v1/rest/glossary-terms/")
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Get glossary term by slug.
|
|
120
|
+
def get_glossary_term(slug)
|
|
121
|
+
get("/api/v1/rest/glossary-terms/#{slug}/")
|
|
122
|
+
end
|
|
123
|
+
# List all guide series.
|
|
124
|
+
def list_guide_series
|
|
125
|
+
get("/api/v1/rest/guide-series/")
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Get guide sery by slug.
|
|
129
|
+
def get_guide_sery(slug)
|
|
130
|
+
get("/api/v1/rest/guide-series/#{slug}/")
|
|
131
|
+
end
|
|
132
|
+
# List all guides.
|
|
133
|
+
def list_guides
|
|
134
|
+
get("/api/v1/rest/guides/")
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Get guide by slug.
|
|
138
|
+
def get_guide(slug)
|
|
139
|
+
get("/api/v1/rest/guides/#{slug}/")
|
|
140
|
+
end
|
|
141
|
+
# List all industries.
|
|
142
|
+
def list_industries
|
|
143
|
+
get("/api/v1/rest/industries/")
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Get industry by slug.
|
|
147
|
+
def get_industry(slug)
|
|
148
|
+
get("/api/v1/rest/industries/#{slug}/")
|
|
149
|
+
end
|
|
150
|
+
# List all pricing.
|
|
151
|
+
def list_pricing
|
|
152
|
+
get("/api/v1/rest/pricing/")
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Get pricing by slug.
|
|
156
|
+
def get_pricing(slug)
|
|
157
|
+
get("/api/v1/rest/pricing/#{slug}/")
|
|
158
|
+
end
|
|
159
|
+
# List all registrar comparisons.
|
|
160
|
+
def list_registrar_comparisons
|
|
161
|
+
get("/api/v1/rest/registrar-comparisons/")
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Get registrar comparison by slug.
|
|
165
|
+
def get_registrar_comparison(slug)
|
|
166
|
+
get("/api/v1/rest/registrar-comparisons/#{slug}/")
|
|
167
|
+
end
|
|
168
|
+
# List all registrars.
|
|
169
|
+
def list_registrars
|
|
170
|
+
get("/api/v1/rest/registrars/")
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Get registrar by slug.
|
|
174
|
+
def get_registrar(slug)
|
|
175
|
+
get("/api/v1/rest/registrars/#{slug}/")
|
|
176
|
+
end
|
|
177
|
+
# List all registries.
|
|
178
|
+
def list_registries
|
|
179
|
+
get("/api/v1/rest/registries/")
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Get registry by slug.
|
|
183
|
+
def get_registry(slug)
|
|
184
|
+
get("/api/v1/rest/registries/#{slug}/")
|
|
185
|
+
end
|
|
186
|
+
# List all stat snapshots.
|
|
187
|
+
def list_stat_snapshots
|
|
188
|
+
get("/api/v1/rest/stat-snapshots/")
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Get stat snapshot by slug.
|
|
192
|
+
def get_stat_snapshot(slug)
|
|
193
|
+
get("/api/v1/rest/stat-snapshots/#{slug}/")
|
|
194
|
+
end
|
|
195
|
+
# List all timeline eras.
|
|
196
|
+
def list_timeline_eras
|
|
197
|
+
get("/api/v1/rest/timeline-eras/")
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Get timeline era by slug.
|
|
201
|
+
def get_timeline_era(slug)
|
|
202
|
+
get("/api/v1/rest/timeline-eras/#{slug}/")
|
|
203
|
+
end
|
|
204
|
+
# List all timeline events.
|
|
205
|
+
def list_timeline_events
|
|
206
|
+
get("/api/v1/rest/timeline-events/")
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Get timeline event by slug.
|
|
210
|
+
def get_timeline_event(slug)
|
|
211
|
+
get("/api/v1/rest/timeline-events/#{slug}/")
|
|
212
|
+
end
|
|
213
|
+
# List all tlds.
|
|
214
|
+
def list_tlds
|
|
215
|
+
get("/api/v1/rest/tlds/")
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Get tld by slug.
|
|
219
|
+
def get_tld(slug)
|
|
220
|
+
get("/api/v1/rest/tlds/#{slug}/")
|
|
221
|
+
end
|
|
222
|
+
# List all tools.
|
|
223
|
+
def list_tools
|
|
224
|
+
get("/api/v1/rest/tools/")
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Get tool by slug.
|
|
228
|
+
def get_tool(slug)
|
|
229
|
+
get("/api/v1/rest/tools/#{slug}/")
|
|
230
|
+
end
|
|
231
|
+
# List all use cases.
|
|
232
|
+
def list_use_cases
|
|
233
|
+
get("/api/v1/rest/use-cases/")
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Get use case by slug.
|
|
237
|
+
def get_use_case(slug)
|
|
238
|
+
get("/api/v1/rest/use-cases/#{slug}/")
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
private
|
|
242
|
+
|
|
243
|
+
def get(path, **params)
|
|
244
|
+
uri = URI.join(@base_url, path)
|
|
245
|
+
uri.query = URI.encode_www_form(params) unless params.empty?
|
|
246
|
+
response = Net::HTTP.get_response(uri)
|
|
247
|
+
raise "HTTP #{response.code}" unless response.is_a?(Net::HTTPSuccess)
|
|
248
|
+
JSON.parse(response.body)
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: tldfyi
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- FYIPedia
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-03-21 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Ruby client for the TLDFYI REST API at tldfyi.com. Zero external dependencies.
|
|
14
|
+
email: dev@fyipedia.com
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/tldfyi.rb
|
|
20
|
+
homepage: https://tldfyi.com
|
|
21
|
+
licenses:
|
|
22
|
+
- MIT
|
|
23
|
+
metadata:
|
|
24
|
+
source_code_uri: https://github.com/fyipedia/tldfyi-rb
|
|
25
|
+
documentation_uri: https://tldfyi.com/api/v1/schema/
|
|
26
|
+
homepage_uri: https://tldfyi.com
|
|
27
|
+
post_install_message:
|
|
28
|
+
rdoc_options: []
|
|
29
|
+
require_paths:
|
|
30
|
+
- lib
|
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
32
|
+
requirements:
|
|
33
|
+
- - ">="
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: '3.0'
|
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
requirements: []
|
|
42
|
+
rubygems_version: 3.0.3.1
|
|
43
|
+
signing_key:
|
|
44
|
+
specification_version: 4
|
|
45
|
+
summary: Ruby client for TLDFYI API
|
|
46
|
+
test_files: []
|