extractus / feed-extractor

Simplest way to read & normalize RSS/ATOM/JSON feed data
https://extractor-demos.pages.dev/feed-extractor
MIT License
144 stars 30 forks source link

Add support for OPML feeds #138

Open theycallhermax opened 1 month ago

theycallhermax commented 1 month ago

An OPML feed is a way for how to integrate many feeds into one, sort of like merging many feeds into one.

Possible implementation

A OPML feed can be imported the same way as a normal feed...

const feed = await extract("https://example.com/feeds.opml");

...and can almost be read the same too...

interface OPMLData {
    title: String;
    feeds: OPMLFeed[];
    entries: OPMLEntry[];
}

interface OPMLFeed {
    title: String;
    link: String;
}

interface OPMLEntry {
    id: String;
    feed: String;
    title: String;
    link: String;
    description: String;
    published: ISO Datetime String;
}

A mock OPML feed can be made by passing an array of feed URLs to the extract function...

const feed = await extract([
    "https://example.com/feed.rss",
    "https://foobar.com/feed.atom"
]);

Things that would be done post-implementation

ndaidong commented 1 month ago

@theycallhermax thank you for your recommendation. This is really useful feature. I will have plan to try implementing.