feat(zol): 中关村在线 (ZOL) no-login adapter — search / rank / param / price / koubei / pic#2015
Open
yixin-1024 wants to merge 2 commits into
Open
feat(zol): 中关村在线 (ZOL) no-login adapter — search / rank / param / price / koubei / pic#2015yixin-1024 wants to merge 2 commits into
yixin-1024 wants to merge 2 commits into
Conversation
ZOL (zol.com.cn) is China's largest digital-product catalogue. All three
commands are PUBLIC fetches of GBK-encoded SSR pages (desktop UA + referer,
decoded via TextDecoder('gbk'), regex-parsed — no login, cookies or signature):
- search search.zol.com.cn/s/all.php → name + 报价 + product id
- param detail.zol.com.cn/0/<id>/param.shtml → full spec sheet (subcat segment
is cosmetic, so only the numeric product id is needed)
- price detail.zol.com.cn/0/<id>/price.shtml → per-platform/seller offers
11 vitest cases against frozen iPhone-15 (1427365) fixtures; tsc clean;
silent-column-drop & typed-error-lint new=0; doc-coverage 172/172. Verified
live against phones (iPhone 15) and laptops (ThinkPad X1).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extends the no-login ZOL adapter from 3 to 6 commands, matching the breadth of
the sibling 懂车帝 adapter. All three new commands are PUBLIC fetches of
GBK-encoded SSR pages (desktop UA + referer, decoded via TextDecoder('gbk'),
regex-parsed — no login, cookies or signature):
- koubei detail.zol.com.cn/0/<id>/review.shtml → user reviews: star score +
续航/拍照/性能/外观 subscores + body snippet + review link
- pic detail.zol.com.cn/0/<id>/pic.shtml → product image gallery
(imgwrap-anchored, deduped by URL)
- rank top.zol.com.cn → hot-product boards (手机/笔记本/显示器/空调/相机);
discovery counterpart to search — surfaces product ids with no keyword
koubei/pic reuse the productId-only `/0/<id>/…` form (301-redirects to the
canonical numeric subcategory, which fetch follows). rank tags each row with its
board category and drops the non-product 品牌排行榜 board automatically.
Login adds nothing for a read adapter: ZOL gates only write/personalized
features (posting reviews, 收藏, 关注, forums), none of which are reproducible
public data — so the adapter stays a pure anonymous fetch.
18 vitest cases against frozen iPhone-15 (1427365) + rankings fixtures; tsc
clean; silent-column-drop & typed-error-lint new=0; doc-coverage 172/172.
Verified live: koubei (real users/scores/subscores), pic (外观图 URLs), rank
(手机/笔记本/显示器/空调 boards).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Broadened the adapter from 3 → 6 commands (matching the sibling 懂车帝 adapter's breadth):
All PUBLIC fetches — login adds nothing for a read adapter (ZOL gates only write/personalized features: posting reviews, 收藏, 关注, forums; none are reproducible public data). koubei/pic reuse the productId-only Gates: 18 vitest cases (frozen fixtures) · tsc clean · silent-column-drop & typed-error-lint new=0 · doc-coverage 172/172. Verified live. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a 中关村在线 (ZOL, zol.com.cn) adapter — China's largest digital-product
catalogue (phones, laptops, cameras, …). Three read-only commands:
zol search <keyword>search.zol.com.cn/s/all.phpzol param <product>detail.zol.com.cn/0/<id>/param.shtmlzol price <product>detail.zol.com.cn/0/<id>/price.shtmlHow
All three are
Strategy.PUBLIC(browser: false) — a plainfetch()of aGBK-encoded SSR page, decoded with
TextDecoder('gbk')and regex-parsed.No login, no cookies, no signature. Same family as the existing car-platform
adapters (懂车帝/汽车之家). Two ZOL quirks handled:
/0/<id>/param.shtmlresolves by product id alone, so
param/priceonly need the id fromsearch.searchdedupes by product id;paramstrips ZOL's "查看…>" link-label chrome soonly real spec values remain;
pricemaps the platform slug(
brand-mol-jd→ 京东,…-tmall→ 天猫,…-taobao→ 淘宝).Tests / gates
tsc --noEmitclean.check:silent-column-dropnew=0,check:typed-error-lintnew=0 (no baseline edits).doc-coverage --strict172/172 (docs/adapters/browser/zol.mdadded).Reviews/评测 and 口碑 are intentionally left out of this first cut (separate pages,
can be added later).
🤖 Generated with Claude Code