scrape-to-feed
Serve feeds from scraped HTML.
Install
npm install scrape-to-feed
Usage
-
At the root of your project, create a
feeds
directory. This directory will contain exported modules for defining your feeds, one feed per file. -
Add a feed. Here is an example,
./feeds/nyt-example-feed.js
:
moduleexports = url: "https://www.nytimes.com/" title: "NYT example feed" ... ;
- Create and serve your feeds:
#!/usr/bin/env node;
- Your feed will be available at:
localhost:3000/nyt-example-feed
Arguments
By default, all feeds will be re-scaped and rebuilt every hour. You can pass a custom interval, like so:
1000 * 60 * 60 * 24; // Update feeds once per day.