hydrafetch 0.8.0 → 0.10.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 +2 -0
- data/lib/hydrafetch/client.rb +14 -1
- data/lib/hydrafetch/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: 1f3c10b7bd158cc49a2db003b8eab826c4bb6a57c6ac713f3ffaff65c7a67df9
|
|
4
|
+
data.tar.gz: 3c4022a5dabb9b3d0cfa4846e7ddeaaf61cd6c948af5bbdd40f3f8918a80c6ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ad4443cce76d5c9666c2bf910ea51a193935b52fa662daed40c9ed41a48e670ab0b3754fb6d9fd049202417425bf519790783b3794bdf1703a7d605eeaa4bf6
|
|
7
|
+
data.tar.gz: f33e8de021dd4ab383ec5c08f88b697911d266b322c09bc386c9aac94c3694ef11f26768d9ce7918aa1699d2024af5b9f07ed87f1d2da8cdd40d21b3257d30c7
|
data/README.md
CHANGED
|
@@ -239,6 +239,8 @@ hf = Hydrafetch::Client.new("hf_...",
|
|
|
239
239
|
| `batch(urls, **options)` | job hash, polled to completion | 1 per page |
|
|
240
240
|
| `start_crawl`, `start_batch` | job id `String` | 1 per page |
|
|
241
241
|
| `crawl_status(id)`, `batch_status(id)` | job hash | free |
|
|
242
|
+
| `cancel_crawl(id)`, `cancel_batch(id)` | job hash | free, pages not yet read are not charged |
|
|
243
|
+
| `submit_batch(urls, **options)` | hash with `batchId`, `status` and `invalidUrls` | 1 per page |
|
|
242
244
|
| `rate_result(rating, request_id:, url:, reasons:, note:)` | rating hash | free |
|
|
243
245
|
|
|
244
246
|
Failed requests are not billed. Pricing does not vary with page difficulty, so there is no render, stealth or proxy option to set.
|
data/lib/hydrafetch/client.rb
CHANGED
|
@@ -117,13 +117,26 @@ module Hydrafetch
|
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
def start_batch(urls, **options)
|
|
120
|
-
|
|
120
|
+
submit_batch(urls, **options)["batchId"]
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def submit_batch(urls, **options)
|
|
124
|
+
payload = post("/v1/web/batch", { urls: urls.to_a }.merge(compact(options)))
|
|
125
|
+
payload.merge("batchId" => job_id(payload, "batchId"))
|
|
121
126
|
end
|
|
122
127
|
|
|
123
128
|
def batch_status(id)
|
|
124
129
|
get("/v1/web/batch/#{escape(id)}")
|
|
125
130
|
end
|
|
126
131
|
|
|
132
|
+
def cancel_crawl(id)
|
|
133
|
+
request(Net::HTTP::Delete, "/v1/web/crawl/#{escape(id)}")
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def cancel_batch(id)
|
|
137
|
+
request(Net::HTTP::Delete, "/v1/web/batch/#{escape(id)}")
|
|
138
|
+
end
|
|
139
|
+
|
|
127
140
|
def crawl(url, poll_interval: 2, job_timeout: 300, on_progress: nil, **options)
|
|
128
141
|
id = start_crawl(url, **options)
|
|
129
142
|
wait(poll_interval, job_timeout, on_progress) { crawl_status(id) }
|
data/lib/hydrafetch/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hydrafetch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hydrafetch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Turn any URL into clean Markdown and structured data. Scrape, map, search,
|
|
14
14
|
extract, brand and bulk crawl through one API.
|