feat(ithome): add IT之家 (IThome) no-login adapter — news / rank / article#2019
Open
yixin-1024 wants to merge 1 commit into
Open
feat(ithome): add IT之家 (IThome) no-login adapter — news / rank / article#2019yixin-1024 wants to merge 1 commit into
yixin-1024 wants to merge 1 commit into
Conversation
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>
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.
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
ithome news [channel]api.ithome.com/json/newslist/<channel>news;apple/android/win/soft/game…) → title + 阅读/评论数 + urlithome rank [board]api.ithome.com/json/newslist/rankithome article <id|url>www.ithome.com/0/<dir>/<id>.htmnews/rankprint anewsid+ articleurl;articleaccepts either a bare newsid (968068→/0/968/068.htm) or the full URL.Deliberately not shipped (investigated; neither login-gated)
so.ithome.comis DNS-sinkholed in this environment (resolves to198.18.x.x), so it can't be reached/tested.cmt.ithome.com/api/webcomment/getnewscomment?sn=…is keyed by an undocumented per-articlesnhash that isn't on the page.Read/comment counts are still surfaced by
newsandrank. The adapter never ships empty/unreliable data.Quality gates (run locally)
tsc --noEmitcleannews+applechannel,rank 评论(周评论榜),articleby newsid and URL🤖 Generated with Claude Code