Repository navigation
VFG-87 記事のページから本文を取る (Zenn とリンク先、決まりを満たすものだけ) - #55
Merged
Merged
Conversation
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.
概要
Zenn の記事や、はてなブックマーク・Hacker News のリンク先は、要約しか材料がなく台本が薄くなる。選んだ 1 件の記事のページ (HTML) を、robots.txt や AI の利用の意思表示などの決まりをすべて満たすときだけ取り、本文を台本の材料にする。
変更内容
src/sources/page/: robots.txt (RFC 9309) の読み取り、AI のクローラ名指しの確認、Content-Usage・Content-Signal・noai・tdm-reservationの確認、Crawl-delay、1 回だけのやり直し、同じホスト内の転送の確認、Readability での本文の抜き出しconfig/article-page.json: AI のクローラの一覧、意思表示の項目、報道のサイトの除外ドメイン、取らないホストscript.check.json(articleBody.skippedBy) に残す。URL・ホストはログに出さない@mozilla/readability0.6.0 (Apache-2.0)、linkedom0.18.15 (ISC)動作確認
pnpm lintpnpm typecheckpnpm test(外部への通信はモック)pnpm format:checkリスクの確認
.env*、キー、トークン) を含めていない人が確認すること
config/article-page.jsonの一覧) が方針に合うか。このブランチはagent/なので、チェックが通ると自動でマージされる点に注意補足
Content-Usageは IETF の草案で、項目名はai-useのほか、草案の例にあるaiも取らない対象にした。草案が変わったら一覧を見直す。