Skip to content

feat(zol): 中关村在线 (ZOL) no-login adapter — search / rank / param / price / koubei / pic#2015

Open
yixin-1024 wants to merge 2 commits into
jackwener:mainfrom
yixin-1024:feat/zol-adapter
Open

feat(zol): 中关村在线 (ZOL) no-login adapter — search / rank / param / price / koubei / pic#2015
yixin-1024 wants to merge 2 commits into
jackwener:mainfrom
yixin-1024:feat/zol-adapter

Conversation

@yixin-1024

Copy link
Copy Markdown
Contributor

What

Adds a 中关村在线 (ZOL, zol.com.cn) adapter — China's largest digital-product
catalogue (phones, laptops, cameras, …). Three read-only commands:

Command Source Returns
zol search <keyword> search.zol.com.cn/s/all.php name + 报价 + product id
zol param <product> detail.zol.com.cn/0/<id>/param.shtml full spec sheet (dimensions/screen/battery/chipset…)
zol price <product> detail.zol.com.cn/0/<id>/price.shtml per-platform/seller offers + buy links

How

All three are Strategy.PUBLIC (browser: false) — a plain fetch() of a
GBK-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:

  • Pages require a desktop UA + a zol referer (a mobile UA gets a 153-byte stub).
  • Detail URLs' subcategory segment is cosmetic/0/<id>/param.shtml
    resolves by product id alone, so param/price only need the id from search.

search dedupes by product id; param strips ZOL's "查看…>" link-label chrome so
only real spec values remain; price maps the platform slug
(brand-mol-jd → 京东, …-tmall → 天猫, …-taobao → 淘宝).

Tests / gates

  • 11 vitest cases against frozen real-data fixtures (iPhone 15 = product 1427365).
  • tsc --noEmit clean.
  • check:silent-column-drop new=0, check:typed-error-lint new=0 (no baseline edits).
  • doc-coverage --strict 172/172 (docs/adapters/browser/zol.md added).
  • Verified live against phones (iPhone 15) and laptops (ThinkPad X1).

Reviews/评测 and 口碑 are intentionally left out of this first cut (separate pages,
can be added later).

🤖 Generated with Claude Code

yixin-1024 and others added 2 commits June 24, 2026 15:56
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>
@yixin-1024 yixin-1024 changed the title feat(zol): add 中关村在线 (ZOL) no-login adapter — search / param / price feat(zol): 中关村在线 (ZOL) no-login adapter — search / rank / param / price / koubei / pic Jun 24, 2026
@yixin-1024

Copy link
Copy Markdown
Contributor Author

Broadened the adapter from 3 → 6 commands (matching the sibling 懂车帝 adapter's breadth):

  • koubei <product> — user reviews (口碑): 0–5 star score + 续航/拍照/性能/外观 subscores + body snippet + review link
  • pic <product> — product image gallery (外观图/细节图 URLs, imgwrap-anchored, deduped)
  • rank [category] — hot-product boards from top.zol.com.cn (手机/笔记本/显示器/空调/相机); the discovery counterpart to search, surfacing product ids with no keyword

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 /0/<id>/… form (301→canonical subcat, fetch follows).

Gates: 18 vitest cases (frozen fixtures) · tsc clean · silent-column-drop & typed-error-lint new=0 · doc-coverage 172/172. Verified live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant