fetch-site-rss

Fetch a site's RSS feed.

Usage no npm install needed!

<script type="module">
  import fetchSiteRss from 'https://cdn.skypack.dev/fetch-site-rss';
</script>

README

fetch-site-rss

Fetch a site's RSS feed.

Why?

... because you only know a site's homepage (ie: http://nytimes.com), but you want to fetch that site's RSS feed. Basically just a cheap wrapper around cheerio and simple-rss.

Installation:

$ npm i fetch-site-rss -S

Usage:

const { getSiteRss } = require('fetch-site-rss');

getSiteRss('http://latimes.com')
  .then((feed) => {
    console.log(`Found ${feed.items.length} items:`);
    feed.items.forEach((item) => {
      console.log(`${item.title}\n${item.permalink || item.link || item['rss:link']['#']}\n`);
    })
  })
  .catch((err) => console.error(err.message));