feedscout
v2.2.1
Published
Advanced feed autodiscovery for JavaScript. Collect feed information from any webpage using multiple discovery methods.
Maintainers
Readme
Feedscout
Advanced feed autodiscovery for JavaScript. Collect feed information from any webpage using multiple discovery methods.
Finds feeds by scanning links and anchors in HTML content, parsing HTTP headers, and guessing common paths, then validates each URL by fetching and parsing the feed.
Read full docs ↗ · Quick Start
Features
Supported Content
| Type | Description | | --- | --- | | Feeds | RSS, Atom, JSON Feed, and RDF. Each feed is validated and returns metadata like format, title, description, and site URL. | | Blogrolls | OPML files containing feed subscriptions. Each blogroll is validated and returns its title. | | Favicons | Site icons from HTML, feeds, platform APIs, and common paths. Validated to ensure URLs point to actual images. | | WebSub | Hubs for real-time feed update notifications. |
Discovery Methods
| Method | Description |
| --- | --- |
| Platform | Generates feed URLs for YouTube, GitHub, WordPress, and 270+ other platforms using URL pattern matching. |
| HTML | Scans <link> elements with feed MIME types or rel="feed", and <a> elements matching feed patterns or labels like "RSS", "Feed" or "Atom". |
| Headers | Parses HTTP Link headers for rel="alternate" with feed MIME types, or rel="feed", per RFC 8288. |
| Guess | Tests common paths (e.g. /feed, /rss.xml, /atom.xml) against the base URL as a fallback. |
Customization
Uses native fetch by default but supports custom adapters for Axios, Got, Ky, or any other HTTP client. Discovery methods can be individually enabled or disabled and their options adjusted. Custom extractors let you override the default parser to pull additional metadata from feeds and blogrolls.
Quick Start
For a full overview of all the features, visit the documentation.
Installation
npm install feedscoutDiscover Feeds
import { discoverFeeds } from 'feedscout'
const feeds = await discoverFeeds('https://example.com')
// [{
// url: 'https://example.com/feed.xml',
// isValid: true,
// format: 'rss',
// title: 'Example Blog',
// description: 'A blog about examples',
// siteUrl: 'https://example.com/',
// method: 'html',
// }]const feeds = await discoverFeeds('https://example.com', {
methods: ['html', 'headers'],
})Or with existing HTML content:
<html>
<head>
<link rel="alternate" type="application/rss+xml" href="/feed.xml" />
</head>
<body>
<a href="/rss">RSS Feed</a>
</body>
</html>const feeds = await discoverFeeds(
{ url: 'https://example.com', content: html },
{ methods: ['html'] },
)
// [
// {
// url: 'https://example.com/feed.xml',
// isValid: true,
// format: 'rss',
// title: 'Example Blog',
// description: 'A blog about examples',
// siteUrl: 'https://example.com/',
// method: 'html',
// },
// {
// url: 'https://example.com/rss',
// isValid: true,
// format: 'rss',
// title: 'Example Blog',
// description: 'A blog about examples',
// siteUrl: 'https://example.com/',
// method: 'html',
// },
// ]Or with HTTP headers:
Link: </feed.xml>; rel="alternate"; type="application/rss+xml"const feeds = await discoverFeeds(
{ url: 'https://example.com', headers },
{ methods: ['headers'] },
)
// [{
// url: 'https://example.com/feed.xml',
// isValid: true,
// format: 'rss',
// title: 'Example Blog',
// description: 'A blog about examples',
// siteUrl: 'https://example.com/',
// method: 'headers',
// }]Discover Blogrolls
import { discoverBlogrolls } from 'feedscout'
const blogrolls = await discoverBlogrolls('https://example.com')
// [{
// url: 'https://example.com/blogroll.opml',
// isValid: true,
// title: 'My Blogroll',
// method: 'html',
// }]Discover Favicons
import { discoverFavicons } from 'feedscout'
const favicons = await discoverFavicons('https://example.com')
// [{
// url: 'https://example.com/apple-touch-icon.png',
// isValid: true,
// method: 'html',
// }]Discover WebSub Hubs
import { discoverHubs } from 'feedscout'
const hubs = await discoverHubs('https://example.com/feed.xml')
// [{
// hub: 'https://pubsubhubbub.appspot.com/',
// topic: 'https://example.com/feed.xml',
// }]