Skip to main content

discover_feed

Function discover_feed 

Source
pub fn discover_feed(site_html: &str, base: Option<&Url>) -> Option<Url>
Expand description

Discover a feed URL from a site’s HTML via <link rel="alternate" type="application/rss+xml|atom+xml" href="…">.

Returns the first RSS/Atom autodiscovery link found, resolved against the page URL if the href is relative. This is what lets a user paste a site URL and have FeatherReader find the actual feed (“subscribe by URL”). Returns None if the HTML carries no autodiscovery link.

The base is the URL the HTML was fetched from, used to resolve relative hrefs. Pass None to only accept absolute hrefs.