hydrafetch 0.3.0 → 0.5.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 +32 -0
- data/lib/hydrafetch/client.rb +15 -0
- 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: a2db80b66abcc7cb6948142487ea814abe860920e18eeff4e0fe288b08d82490
|
|
4
|
+
data.tar.gz: 02bd43273da1066e14cb2f36645d7d4e127028e068ff10f372d5c1ab59d77614
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bdd7d850c628a7fe035026a462aa0355bf114dc02b8cbd5b61a4a248773a4fd9097558833ec6b11c7665bda288e9f4884c015df93851271133b7dc92f60cef57
|
|
7
|
+
data.tar.gz: 0a524dbaaf0078234d73c532c1583401de9b4d3e83b2138a12de716dc92b0a73714564d572056559b5837749af742826488c44b989db8728ab8684dc6ddffe9b
|
data/README.md
CHANGED
|
@@ -120,6 +120,35 @@ res["results"].each do |r|
|
|
|
120
120
|
end
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
+
## News
|
|
124
|
+
|
|
125
|
+
Find recent news articles about anything, newest first, each with its outlet and publish time:
|
|
126
|
+
|
|
127
|
+
```ruby
|
|
128
|
+
news = hf.news("acme raises funding", timeRange: "week", limit: 10)
|
|
129
|
+
news["results"].each { |a| puts "#{a["publishedAt"]} #{a["title"]} #{a["url"]}" }
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
A news search costs 1 credit, and one that finds nothing is free. Pass `scrapeResults: true` to also read each article as clean data, at 1 extra credit per article.
|
|
133
|
+
|
|
134
|
+
## Jobs
|
|
135
|
+
|
|
136
|
+
Search open jobs collected from company career sites and hiring platforms, by the words in the job title:
|
|
137
|
+
|
|
138
|
+
```ruby
|
|
139
|
+
jobs = hf.search_jobs("data engineer", location: "Berlin", postedWithinDays: 14, limit: 20)
|
|
140
|
+
jobs.each { |job| puts "#{job["title"]} #{job["domain"]} #{job["url"]}" }
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
See what changed in a company's hiring since a date: what is open now, what opened and what closed, by department, seniority and location, with the jobs themselves:
|
|
144
|
+
|
|
145
|
+
```ruby
|
|
146
|
+
acme = hf.hiring_changes("acme.com", "2026-10-01").first
|
|
147
|
+
puts acme["totals"] # {"open"=>42, "opened"=>6, "closed"=>3}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
A search costs 1 credit per 10 jobs returned, and an empty one is free. Hiring changes cost 1 credit per company we have jobs for; companies we do not track yet come back empty and are free.
|
|
151
|
+
|
|
123
152
|
## Brand data
|
|
124
153
|
|
|
125
154
|
```ruby
|
|
@@ -195,6 +224,9 @@ hf = Hydrafetch::Client.new("hf_...",
|
|
|
195
224
|
| `markdown(url, **options)` | `String` | 1 |
|
|
196
225
|
| `map(url, **options)` | links hash | 1 |
|
|
197
226
|
| `search(query, **options)` | results hash | 1 + 1 per scraped result |
|
|
227
|
+
| `news(query, **options)` | articles, newest first | 1 + 1 per article read; free when empty |
|
|
228
|
+
| `search_jobs(query, **options)` | array of jobs | 1 per 10 jobs |
|
|
229
|
+
| `hiring_changes(domains, since, **options)` | array of companies | 1 per company with jobs |
|
|
198
230
|
| `extract(urls, **options)` | hash with `"results"` | 5 per URL |
|
|
199
231
|
| `brand(domain)` | brand hash | 5 |
|
|
200
232
|
| `logo(domain, **options)` | logo hash | 1 |
|
data/lib/hydrafetch/client.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require "json"
|
|
2
2
|
require "net/http"
|
|
3
|
+
require "time"
|
|
3
4
|
require "uri"
|
|
4
5
|
|
|
5
6
|
require_relative "errors"
|
|
@@ -54,6 +55,20 @@ module Hydrafetch
|
|
|
54
55
|
post("/v1/web/search", { query: query }.merge(compact(options)))
|
|
55
56
|
end
|
|
56
57
|
|
|
58
|
+
def news(query, **options)
|
|
59
|
+
post("/v1/web/news", { query: query }.merge(compact(options)))
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def search_jobs(query, **options)
|
|
63
|
+
post("/v1/web/index/jobs/search", { query: query }.merge(compact(options)))
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def hiring_changes(domains, since, **options)
|
|
67
|
+
list = domains.is_a?(String) ? [domains] : domains.to_a
|
|
68
|
+
at = since.respond_to?(:iso8601) ? since.iso8601 : since
|
|
69
|
+
post("/v1/web/index/jobs/changes", { domains: list, since: at }.merge(compact(options)))
|
|
70
|
+
end
|
|
71
|
+
|
|
57
72
|
def extract(urls, **options)
|
|
58
73
|
list = urls.is_a?(String) ? [urls] : urls.to_a
|
|
59
74
|
post("/v1/web/extract", { urls: list }.merge(compact(options)))
|
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.5.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
|
+
date: 2026-11-05 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.
|