hydrafetch 0.1.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35ac08607d9ee8ca889a20a004a731c7209f6073fff19bb0b03f2fe81c43727b
4
- data.tar.gz: 43d69727dfe8f80e5568b7aaac052ef0f26c7d794a613676034c523a2fd1b32b
3
+ metadata.gz: 8315d841963babfe427b351e7dc67e93ddfe23c62df84e0e2e43e075337b0859
4
+ data.tar.gz: 14b9d93b55922cb3201ae02721e265e9517251c54cbb27517571c8f2688d3695
5
5
  SHA512:
6
- metadata.gz: 911787510a48aeca53334e2091d76cb6eb011cce68f7138fed1b861cc5eb6d23732a45d3dc82184016bda179cd23f97372bc18aea07a4ef34a48a43ab73e96b5
7
- data.tar.gz: 77475fd922ba15a0d68d62868b8fc20fa22c385ab37ff2d225a256e8d4a01fcc7f3e80101885c55d9183a6ee6adca681692b2206f6b47bce887b8959e2aa70da
6
+ metadata.gz: 36a5552a71ef177fe621cffcec5b951bc5710b268ec106f0fb8778a0b9bac17aedd5357a4ab87fb7eaeb2030914f55a18539ccf3d04ead7a75ba4969e3658722
7
+ data.tar.gz: 58106f6c25a36035f95d679b96d455a8352cdaff5506370e2ef30b601b743aa2e5db8ceeb5ddfe879b1c365dfb395b10edd533d039ee85b0e87b9256c5c2f278
data/README.md CHANGED
@@ -126,6 +126,7 @@ end
126
126
  hf.brand("stripe.com") # logos, colours, fonts, socials
127
127
  hf.logo("stripe.com", theme: "dark", type: "icon") # one asset
128
128
  hf.styleguide("stripe.com") # computed design system
129
+ hf.styleguide("https://stripe.com/pricing", maxAge: 0) # one page, read fresh
129
130
  ```
130
131
 
131
132
  For logos in a browser use [`@hydrafetch/client-sdk`](https://github.com/Hydrafetch/client-sdk) with a publishable key. Those bill against logo pulls rather than credits.
@@ -181,7 +182,7 @@ hf = Hydrafetch::Client.new("hf_...",
181
182
  | `extract(urls, **options)` | hash with `"results"` | 5 per URL |
182
183
  | `brand(domain)` | brand hash | 5 |
183
184
  | `logo(domain, **options)` | logo hash | 1 |
184
- | `styleguide(domain)` | design system hash | 10 |
185
+ | `styleguide(domain_or_url, **options)` | design system hash | 10 |
185
186
  | `screenshot(url, **options)` | screenshot hash | 5 |
186
187
  | `images(url)`, `links(url)` | page assets | 1 |
187
188
  | `crawl(url, **options)` | job hash, polled to completion | 1 per page |
@@ -57,8 +57,9 @@ module Hydrafetch
57
57
  get("/v1/web/brand/logo", { domain: domain }.merge(compact(options)))
58
58
  end
59
59
 
60
- def styleguide(domain)
61
- get("/v1/web/styleguide", domain: domain)
60
+ def styleguide(domain_or_url, **options)
61
+ key = domain_or_url.match?(%r{\Ahttps?://}i) ? :url : :domain
62
+ get("/v1/web/styleguide", { key => domain_or_url }.merge(compact(options)))
62
63
  end
63
64
 
64
65
  def screenshot(url, **options)
@@ -1,3 +1,3 @@
1
1
  module Hydrafetch
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
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.1.1
4
+ version: 0.2.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-08-21 00:00:00.000000000 Z
11
+ date: 2026-10-10 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.