Skip to content

feat(ithome): add IT之家 (IThome) no-login adapter — news / rank / article#2019

Open
yixin-1024 wants to merge 1 commit into
jackwener:mainfrom
yixin-1024:feat/ithome-adapter
Open

feat(ithome): add IT之家 (IThome) no-login adapter — news / rank / article#2019
yixin-1024 wants to merge 1 commit into
jackwener:mainfrom
yixin-1024:feat/ithome-adapter

Conversation

@yixin-1024

Copy link
Copy Markdown
Contributor

Adds a no-login (PUBLIC) adapter for IT之家 (IThome, ithome.com), a major Chinese tech-news site. It exposes a clean UTF-8 JSON API for news + 热榜 and serves articles as plain SSR HTML — no login, cookies or signature.

Commands

Command Source Description
ithome news [channel] api.ithome.com/json/newslist/<channel> Latest news (default news; apple/android/win/soft/game…) → title + 阅读/评论数 + url
ithome rank [board] api.ithome.com/json/newslist/rank 热榜: 48小时 / 周热门 / 周评论 / 月榜, tagged by board + hits + comments
ithome article <id|url> www.ithome.com/0/<dir>/<id>.htm Full text: 标题 / 标签 / 正文 paragraphs

news/rank print a newsid + article url; article accepts either a bare newsid (968068/0/968/068.htm) or the full URL.

Deliberately not shipped (investigated; neither login-gated)

  • search — the search host so.ithome.com is DNS-sinkholed in this environment (resolves to 198.18.x.x), so it can't be reached/tested.
  • comment (热评) — cmt.ithome.com/api/webcomment/getnewscomment?sn=… is keyed by an undocumented per-article sn hash that isn't on the page.

Read/comment counts are still surfaced by news and rank. The adapter never ships empty/unreliable data.

Quality gates (run locally)

  • 10 vitest cases against frozen fixtures (news/rank JSON + article HTML, newsid 968068)
  • tsc --noEmit clean
  • silent-column-drop new=0, typed-error-lint new=0
  • doc-coverage green
  • Verified live: news + apple channel, rank 评论 (周评论榜), article by newsid and URL

Note: fork-PR workflows stay at action_required until a maintainer clicks "Approve and run workflows", so the gates above were reproduced locally.

🤖 Generated with Claude Code

IT之家 (ithome.com) is a major Chinese tech-news site. All three commands are
PUBLIC fetches (no login, cookies or signature) of its clean UTF-8 JSON API and
SSR article pages:

- news    api.ithome.com/json/newslist/<channel> → latest list (default `news`;
          channels apple/android/win/soft/game…): title + 阅读/评论数 + url
- rank    api.ithome.com/json/newslist/rank → four 热榜 boards (48小时/周热门/
          周评论/月榜), each row tagged with its board + hits + comments
- article www.ithome.com/0/<dir>/<id>.htm → 标题 / 标签 / 正文 paragraphs
          (post_content, bounded before the related/comment sections)

news/rank print a newsid + article url; article accepts either a bare newsid
(968068 → /0/968/068.htm) or the full URL.

Deliberately NOT shipped (investigated, neither login-gated): keyword search
(so.ithome.com is DNS-sinkholed here → 198.18.x.x, unreachable) and the comment
热评 stream (cmt.ithome.com getnewscomment is keyed by an undocumented per-
article `sn` hash not present on the page). Read/comment counts are still
surfaced by news/rank.

10 vitest cases against frozen fixtures (news/rank JSON + article HTML for
newsid 968068); tsc clean; silent-column-drop & typed-error-lint new=0;
doc-coverage all green. Verified live (news + apple channel, 周评论榜 rank,
article by newsid and URL).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant