Commit 8a0450e9 authored by 谢宇轩's avatar 谢宇轩

docs: add digitimes-feed bundle

parent 0f8f60f8
{
"format": "news-harvester-source",
"version": 1,
"exportedAt": "2026-09-11T02:52:31.294Z",
"source": {
"id": "digitimes-feed",
"name": "电子时报·动态",
"homepageUrl": "https://www.digitimes.com/calendar.php?d=7d",
"method": "browser",
"vaultFolder": "电子时报/动态"
},
"files": {
"helpers/digitimes-feed.md": "---\nsource: digitimes-feed\nlistSelector: \"div.media-container\"\nlinkSelector: 'a[href]'\nurlPattern: 'digitimes\\.com/news/a\\d+.*\\.html'\nexcludeUrlPattern: 'a\\d{8}PR\\d+'\nscrollSteps: 3\nscrollWaitMs: 2000\nwaitMs: 15000\nmaxLinks: 200\n# ── 翻页(可选)── 站点把文章列表分多页时启用。两种模式互斥,最多配一个。\n# 配了翻页字段后还需在 config.json 该 source 下设 paginate: true 才生效。\n# nextSelector: 'a.next' # 点击\"下一页\"元素翻页\n# pageUrlTemplate: null # 或用 URL 模板 'https://site.com/news/page/{page}'\n# pageStart: 2 # pageUrlTemplate 起始页码(≥2)\n# maxPages: 5 # 最多翻页数(不含首页)\n# pageWaitMs: null # 翻页后等待(null 回退到 scrollWaitMs)\nbodySelectors:\n - '[class*=\"articleBodyContent\"] p'\n - '[class*=\"article-body\"] p'\n - '[id*=\"news_content\"] p'\n - 'article p'\nbodyMinParagraphs: 3\ndateSelector: 'time[datetime]'\nauthorSelector: '[rel=\"author\"], [class*=\"author\"] a'\n# Scope to the article-body container (e.g. '[class*=\"ArticleBody\"] img, article img')\n# so bottom-of-page \"recommended articles\" thumbnails aren't downloaded into assets/.\nimageSelector: 'img'\nimageMinWidth: 200\nexcludeImage:\n - logo\n - icon\n - avatar\n - profile\n - /ad/\n - viewpoint\n# excludeImageSelector drops imgs whose ancestor matches — use for\n# \"recommended/related articles\" thumbnails sharing the hero image's CDN host.\n# excludeImageSelector: '[class*=\"RelatedArticle\"], [class*=\"RecommendedArticle\"]'\ntitleStripSuffix: ' ?\\|? ?DIGITIMES.*'\nmaxBodyChars: 15000\n---\n# 电子时报·动态 抓取备忘\n\n- 列表页 https://www.digitimes.com/calendar.php?d=7d 是 7 天全量文章流(跨栏目),\n 文章卡片容器 `div.media-container` 实测 348 个候选链接(inspect 自动生成)。\n 页面另有 `div.related-frame`(PR 侧栏)、`div.display-1`(单条 PR 头条)等小容器,\n 均不在 listSelector 内。\n- urlPattern 锁定文章形态 `/news/a<日期><类别码><序号>[/slug].html`(沿用 digitimes-tech\n 已验证的站点级形态,inspect 自动推断的单篇 URL 已手改覆盖)。部分链接带 `?chid=9`\n 查询参数,模式为子串匹配,不受影响。\n- excludeUrlPattern 排除 `PR` 类别码(企业新闻稿,侧栏 related-frame / display-1 全是 PR)。\n- maxLinks: 200 —— 7 天全量流实测 ~350 条(每天一个 div.media-container,共 7 个容器),\n 默认上限 30 会截断列表;200 留有余量且限定采集规模。\n- 正文/标题选择器沿用 digitimes-tech 同站点已验证配置。\n- 付费墙站点:登录态存于 9222 端口常驻 Chromium 的用户 profile,登录失效时 preview/harvest\n 退出码 70,届时用 ensure-chromium.js --login --url https://www.digitimes.com/ 重新登录。\n- 与 digitimes-tech 内容重叠:harvester 对含 \"/\" 的 vaultFolder 按\"电子时报\"主目录跨栏目去重,\n 两源同收不会重复入库(7 天 registry 窗口内)。\n- 验证: node scripts/preview.js --url https://www.digitimes.com/calendar.php?d=7d --recipe helpers/digitimes-feed.md --count 3(链接为真实文章且 charCount>500 即通过)",
"helpers/digitimes-feed.fixtures.json": "{\n \"_comment\": \"Regression fixtures for the digitimes-feed recipe (7-day calendar feed, cross-channel). Article URLs must fetch with body >= 500 chars (paywalled — requires logged-in browser on cdpPort 9222). Mix of VL/PD category codes picked from div.media-container on 2026-09-11. Update when archived — pick current articles with the same /news/a<date><code>/ path shape, never PR codes.\",\n \"articles\": [\n \"https://www.digitimes.com/news/a20260911VL200/oracle-revenue-cost-infrastructure-business.html\",\n \"https://www.digitimes.com/news/a20260911VL201/oracle-2027-earnings-revenue-business.html\",\n \"https://www.digitimes.com/news/a20260910VL221/robotics-nvidia-software-cost-robot.html\",\n \"https://www.digitimes.com/news/a20260911PD209/apple-iphone-market-launch-demand.html\",\n \"https://www.digitimes.com/news/a20260911PD203/mediatek-revenue-outlook-2026-performance.html\"\n ],\n \"sections\": [\n \"https://www.digitimes.com/calendar.php?d=7d\",\n \"https://www.digitimes.com/news/\"\n ],\n \"minLinks\": 150\n}\n"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment