fetch_util 0.3.2 → 0.4.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: 8f8adcce7137bb744a361c30f0a2f47ea9f26e751cab745f0b298148151c0ea8
4
- data.tar.gz: edbff86bc67288848d4e4c2548c6e8c5b7b53bcc4c29cc10a3d70e9831d19dec
3
+ metadata.gz: 423504e91e312b0131bc310777b0ea99c140c6a14ae4a71ccc5d7ae6f79bcb94
4
+ data.tar.gz: d056c04bc10a76322408c05be13ac1024bd654918f66e01dc338450475d40abb
5
5
  SHA512:
6
- metadata.gz: 85ce1b2472bb679c4f5941d3f828cfbc6455732b81c31952e1d9a5582fbfaa78af247e3ea88fe7a20fdfdcd60d6f50b124e662d6f139891c703060938ff4977d
7
- data.tar.gz: b43a3c4ac0ab6d469c895ca8a12aca159b9d8112de63074497dec4e73178340b2bab666c5f2c7bb3a7ac9f1326c551816a16fed65733f06449a95bab1178a150
6
+ metadata.gz: 69484fc563f44a42e6bcce821d139aa17cabb2027fc501a3e68847061933a5bdfbcf3da9b72d5f092725064bc64b6387e78abe2cab5279ba09bec9b1059a8506
7
+ data.tar.gz: c40a19ca492c9e75037921e1dbd73f999ab848ddee57a1b5b6a34e46a8c14eed1a6ed0b84348bd0843e526f595fb44f1dbfeef1f7cdd2add85adfd8f400b0481
data/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v0.4.0 - 2026-07-11
6
+
7
+ ### Added
8
+
9
+ - Add dedicated result types and structured fields for social posts, threads, feeds, and profiles; products; properties; lodging; jobs; events; recipes; podcasts; sports; medical content; government notices; and press releases.
10
+ - Add explicit language output, direct PDF results, YAML front matter for the default Markdown format, and opt-in URL fields through `--include-urls`.
11
+ - Add public extraction support for Mastodon, Bluesky, Telegram, Hacker News, GitHub discussions, Reddit, Discourse, Stack Exchange, Stack Overflow, Wykop, and other social/community page shapes.
12
+ - Add deterministic content-fidelity contracts covering section coverage, DOM order, card-local context, canonical deduplication, chrome leakage, and focal article structure.
13
+
14
+ ### Fixed
15
+
16
+ - Preserve complete, DOM-ordered visible content across portal sections, feeds, search results, documentation indexes, social threads, structured content, financial links, glossary entries, large sports tables, and search snippets without silent presentation caps.
17
+ - Improve generic homepage, article, list, documentation, warning, and content-ownership arbitration across multilingual news, reference, commerce, social, legal, medical, and JavaScript-heavy pages.
18
+ - Improve WP and Onet homepage fidelity, Wykop home/tag feeds, Ringier article bodies, MDN reference hierarchy, Mastodon and Telegram live routes, and Polish portal warning semantics.
19
+ - Prevent publisher-specific Ringier extraction from mutating the shared media engine; separate WP and Onet homepage ownership while retaining neutral shared list primitives.
20
+ - Normalize IRI input, strengthen browser navigation resilience, constrain false financial appendices, and reduce mismatch, multi-topic, homepage-index, access-wall, and truncation false positives.
21
+
22
+ ### Changed
23
+
24
+ - Move editable JavaScript and its ordered manifest to root `websieve/`; generated runtime assets remain packaged under `lib/fetch_util/assets/`.
25
+ - Reorganize JavaScript by systems, content types, profiles, classifiers, and extraction concerns; split oversized modules and normalize manifest dependency order and registration ownership.
26
+ - Change default fetch rendering to YAML-front-matter-prefixed Markdown. JSON, JSONL, and front matter now share one filtered field contract, with URL fields hidden unless requested.
27
+ - Sanitize unreleased fixtures and assertions with synthetic content while preserving selectors, schemas, structure, scripts, counts, order, and regression intent.
28
+
29
+ ### Performance
30
+
31
+ - Reduce browser stabilization and consent-handling latency while preserving retry behavior for transient navigation and pending-connection failures.
32
+ - Remove redundant fixture resets and consolidate shared extraction, metadata, address, description, cleanup, and registration helpers.
33
+
5
34
  ## v0.3.2 - 2026-07-09
6
35
 
7
36
  ### Added
data/README.md CHANGED
@@ -77,7 +77,7 @@ fetch_util regulatory https://example.com/article --sources=machine,human
77
77
 
78
78
  - `FetchUtil.fetch(url, **options)` returns a `FetchUtil::Result`
79
79
  - `FetchUtil.fetch_many(urls, **options)` fetches multiple URLs in parallel and preserves input order
80
- - `FetchUtil.search(query, **options)` returns compact aggregated search results
80
+ - `FetchUtil.search(query, **options)` returns aggregated search results from the fetched responses; pass `limit:` to request an explicit result cap
81
81
  - `FetchUtil.regulatory(url, **options)` returns a source-keyed hash of allow/disallow signals for crawling, indexing, and TDM-style usage
82
82
  - `FetchUtil::Fetcher.new(**options).fetch(url)` exposes the instance API directly
83
83
 
@@ -96,6 +96,7 @@ Useful result fields:
96
96
  - `timeout:` browser timeout in seconds
97
97
  - `wait:` additional settle delay after page load
98
98
  - `wait_for_idle:` wait for Ferrum network idle before extraction
99
+ - `limit:` search-only explicit maximum result count; omitted by default, search returns every result in the fetched responses
99
100
  - `idle_duration:` idle duration passed to Ferrum when `wait_for_idle` is enabled
100
101
  - `reader_mode:` prefer Readability before heuristic fallbacks
101
102
  - `viewport:` viewport hash with `:width` and `:height`
@@ -105,11 +106,8 @@ Useful result fields:
105
106
 
106
107
  ## Output Shape
107
108
 
108
- `fetch` defaults to compact JSON intended for downstream agent/tool consumption. The default payload keeps the fields that are usually most useful in practice:
109
+ Structured `fetch` output is compact JSON intended for downstream agent/tool consumption. The default payload keeps the fields that are usually most useful in practice:
109
110
 
110
- - `url`
111
- - `final_url`
112
- - `canonical_url`
113
111
  - `title`
114
112
  - `byline`
115
113
  - `site_name`
@@ -119,7 +117,7 @@ Useful result fields:
119
117
  - `suspect`
120
118
  - `warnings`
121
119
 
122
- Pass `--include-html` when you explicitly need extracted HTML. Multiple fetch URLs can be streamed as JSON Lines with `--format jsonl`.
120
+ The default `fetch URL` output is Markdown prefixed with standard YAML front matter. The front matter contains the same filtered fields as JSON except `markdown`; the Markdown body follows its closing `---` delimiter. URL fields are omitted from JSON, JSONL, and front matter by default. Pass `--include-urls` to include `url`, `final_url`, and `canonical_url`, and pass `--include-html` to include extracted HTML. Use `--format json` or `--format jsonl` for structured output; multiple Markdown results are emitted as separate front-matter documents.
123
121
 
124
122
  Both CLI commands append requests to `~/.local/state/fetch_util/requests.log` by default. Override with `FETCH_UTIL_REQUEST_LOG` or `--log-path`.
125
123
 
@@ -190,10 +188,10 @@ bundle exec rake
190
188
  ```
191
189
 
192
190
  - The shipped browser bundle is `lib/fetch_util/assets/extract.js`.
193
- - Source JS lives under `lib/fetch_util/assets/src/` and is ordered by `lib/fetch_util/assets/src/manifest.txt`.
191
+ - Source JS lives under `websieve/` and is ordered by `websieve/manifest.txt`.
194
192
  - `bundle exec rake build_extract_assets` rebuilds the bundle and runs `npx terser -cm` before writing `extract.js`.
195
193
  - `bundle exec rake verify_extract_assets` checks that the built bundle matches the current sources.
196
194
  - The default `bundle exec rake` task runs asset verification, specs, and RuboCop.
197
195
  - Direct `bundle exec rspec` runs still check bundle freshness through `spec/build_extract_assets_spec.rb` and enforce the repo-wide SimpleCov minimum.
198
196
 
199
- Do not hand-edit `lib/fetch_util/assets/extract.js`; edit the source files under `lib/fetch_util/assets/src/` and rebuild.
197
+ Do not hand-edit `lib/fetch_util/assets/extract.js`; edit the source files under `websieve/` and rebuild.