Automatic feed discovery when adding feeds #37
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Adding a feed requires the exact RSS/Atom URL. Hunting down that URL on every site is tedious — most sites hide it behind a link in the footer or a standard path like
/feed.Goal
Let the reader discover feed URLs automatically from a site's homepage, so adding a feed can start from the plain site address.
Findings
trafilatura(already a dependency since #23) ships a feeds module for exactly this:determine_feed(htmlstring, params)parses a homepage's HTML and extracts feed URLs fromlink rel="alternate"tags plus common patterns (verified in the installed package,trafilatura/feeds.py). Its higher-levelfind_feed_urls(url)also exists but fetches pages itself, which would bypass the SSRF guard every other fetch goes through._validate_feed_url+_fetch_feed_response, redirects re-validated), then hand the HTML todetermine_feedfor candidate extraction. Candidate URLs are re-validated through the same guard before being offered/stored.FeedParameters(from courlan, used bydetermine_feed) carries the base URL for resolving relative feed links.Plan of attack
services/feed_discovery.py—discover_feeds(conn, site_url) -> list[str]: guarded homepage fetch,determine_feedfor candidates, each candidate re-validated (SSRF guard) and de-duplicated. Returns the candidate list, optionally confirming each parses as a feed (feedparser smoke parse).yunjin discover-feeds <site-url>prints candidates (keeps CLI/feature parity).Branch
feat/issue-37-feed-discoveryCommits
:sparkles: Add feed discovery service on trafilatura's link scanning:sparkles: Add feed discovery to the feeds page and CLINo implementation until the approach gets a nod.