parseapi 1.1.0 → 1.3.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 +4 -4
- data/README.md +15 -1
- data/lib/parseapi/client.rb +14 -5
- data/lib/parseapi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 61e682a9a5ac02f4539b92a60a198c5df729c3fe1f217b7695c31dc659b2e671
|
|
4
|
+
data.tar.gz: 8e9c4698f7a11569e012738d5b38128c741daf614f64bfd22910559851010822
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f6fb0796e7f85b72285842ac69a8773911f098bf3c340d3ba7606bdb3c8162b54a97ed4533aa6ed595c64dd5486962b8851f60960d4598f2c02e473addf4129e
|
|
7
|
+
data.tar.gz: 28353915115ecfafe4a2128e8fd5c98283c0f28de71f279d60d9b7b2ecebae6dcfc0c7489846decde86461a84037975a1b229520ab2e0c2bf1582fd7ca3af60b
|
data/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Get a key at [parseapi.com](https://parseapi.com). The client also reads `PARSEA
|
|
|
13
13
|
|
|
14
14
|
## API versions
|
|
15
15
|
|
|
16
|
-
Version 1.
|
|
16
|
+
Version 1.3.0 explicitly selects the API contract supported by this SDK. It sends `Parse-Version: 2.0.0` on every lookup so responses match the API contract supported by the package. Your key and the team's saved default stay the same.
|
|
17
17
|
|
|
18
18
|
Upgrade the dependency in staging, review the [release notes](https://parseapi.com/docs/releases), and test the application before deploying the same code and dependency version to production. Commit your dependency lockfile so the tested package travels with your deployment. Future major SDK upgrades can select a newer API contract.
|
|
19
19
|
|
|
@@ -265,3 +265,17 @@ basic = parse.time('America/New_York')
|
|
|
265
265
|
detail = parse.time('America/New_York', deep: true)
|
|
266
266
|
puts basic['at'], detail.dig('deep', 'next_dst')
|
|
267
267
|
```
|
|
268
|
+
|
|
269
|
+
## Stack API
|
|
270
|
+
|
|
271
|
+
```ruby
|
|
272
|
+
result = parse.stack("example.com")
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Pass a public hostname without a scheme, path, port or IP address. Stack returns the checked URL and `checked_at` time, followed by `scope`, `pages` and `partial`. `scope` is `homepage` or `site`; `pages` counts successfully checked HTML pages. `partial` is true for homepage-only or incomplete bounded site checks. False means the known in-scope candidates were completed, not that every page on a website was visited. A homepage result has `scope: "homepage"`, `pages: 1` and `partial: true`.
|
|
276
|
+
|
|
277
|
+
`cms`, `servers`, `frameworks`, `ecommerce`, `analytics`, `chat`, `payments` and `hosting` are arrays because a site can use several technologies in each category. Each entry contains `technology`, `name` and nullable `version`. Technology codes are open strings. A successful check uses empty arrays for categories with no matches. When no HTML page could be checked, `checked_at` and all categories are null, `pages` is 0 and `partial` is null. Unknown or conflicting versions are null. Missing detections do not prove absence.
|
|
278
|
+
|
|
279
|
+
Successful checks may be reused for up to 24 hours. `pretty` optionally formats the wire JSON. Stack uses your plan's request allowance and API version 2.0.0 selected by this client.
|
|
280
|
+
|
|
281
|
+
Stack defaults to a 35-second transport timeout so a first scan has time to finish. Other lookups retain their 10-second default. An explicit client timeout takes precedence.
|
data/lib/parseapi/client.rb
CHANGED
|
@@ -38,6 +38,7 @@ module ParseAPI
|
|
|
38
38
|
|
|
39
39
|
@base_url = URI((base_url || ENV['PARSEAPI_BASE_URL'] || DEFAULT_BASE_URL).sub(%r{/+\z}, ''))
|
|
40
40
|
@timeout = timeout || DEFAULT_TIMEOUT
|
|
41
|
+
@timeout_explicit = !timeout.nil?
|
|
41
42
|
@retries = retries
|
|
42
43
|
raise ArgumentError, 'parseapi: timeout must be a finite positive number.' unless @timeout.is_a?(Numeric) && @timeout.finite? && @timeout > 0
|
|
43
44
|
raise ArgumentError, 'parseapi: retries must be a non-negative integer or nil.' unless @retries.nil? || (@retries.is_a?(Integer) && @retries >= 0)
|
|
@@ -205,6 +206,13 @@ module ParseAPI
|
|
|
205
206
|
get("/hlr/#{seg(number)}", country: country, deep: deep)
|
|
206
207
|
end
|
|
207
208
|
|
|
209
|
+
# Identify website technologies and versions by category.
|
|
210
|
+
# All categories are lists. Scope, pages and partial describe bounded coverage.
|
|
211
|
+
# Lists are nil when no page could be checked and empty for no matches.
|
|
212
|
+
def stack(domain, deep: false, pretty: false)
|
|
213
|
+
get("/stack/#{seg(domain)}", deep: deep, pretty: pretty)
|
|
214
|
+
end
|
|
215
|
+
|
|
208
216
|
# Check whether a domain is registered. Deep adds registration dates, registrar, status and DNSSEC on paid plans.
|
|
209
217
|
def domain(domain, deep: false)
|
|
210
218
|
get("/domain/#{seg(domain)}", deep: deep)
|
|
@@ -390,7 +398,8 @@ module ParseAPI
|
|
|
390
398
|
def execute(uri, headers)
|
|
391
399
|
return @transport.call(uri.to_s, headers) if @transport
|
|
392
400
|
|
|
393
|
-
|
|
401
|
+
timeout = !@timeout_explicit && uri.path.start_with?('/stack/') ? 35 : @timeout
|
|
402
|
+
http = connection(timeout)
|
|
394
403
|
request = Net::HTTP::Get.new(uri.request_uri)
|
|
395
404
|
headers.each { |name, value| request[name] = value }
|
|
396
405
|
response = http.request(request)
|
|
@@ -399,17 +408,17 @@ module ParseAPI
|
|
|
399
408
|
[response.code.to_i, header_hash, response.body || '']
|
|
400
409
|
end
|
|
401
410
|
|
|
402
|
-
def connection
|
|
411
|
+
def connection(timeout = @timeout)
|
|
403
412
|
if @http.nil?
|
|
404
413
|
@http = Net::HTTP.new(@base_url.host, @base_url.port)
|
|
405
414
|
@http.use_ssl = @base_url.scheme == 'https'
|
|
406
|
-
@http.open_timeout = @timeout
|
|
407
|
-
@http.read_timeout = @timeout
|
|
408
|
-
@http.write_timeout = @timeout
|
|
409
415
|
# The client owns retries, including retries: 0.
|
|
410
416
|
@http.max_retries = 0
|
|
411
417
|
@http.keep_alive_timeout = 30
|
|
412
418
|
end
|
|
419
|
+
@http.open_timeout = timeout
|
|
420
|
+
@http.read_timeout = timeout
|
|
421
|
+
@http.write_timeout = timeout
|
|
413
422
|
@http.start unless @http.started?
|
|
414
423
|
@http
|
|
415
424
|
end
|
data/lib/parseapi/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parseapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ParseAPI
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|