@pharastar/rss-feed-watcher
v0.0.1
Published
A Simple Watcher for RSS Feeds emitting "data"event on new entries.
Downloads
21
Maintainers
Readme
@pharastar/rss-feed-watcher
Install Commnd npm i --save @pharastar/rss-feed-watcher
Import NodeJS
const FeedWatcher = require('@pharastar/rss-feed-watcher');
Listen for new entries in RSS feeds
const FEED = 'https://www.reddit.com/r/news+minecraft+reddit+memes/new.rss'; // Feed URL
const UPDATE_INTERVAL = 10; // interval in seconds
let watcher = new FeedWatcher(FEED, UPDATE_INTERVAL);
watcher.on('data', (entries) => {
console.log(entries.map((e) => e.link));
});
watcher
.start()
.then((initials) => {
console.log(initials.map((i) => i.link));
})
.catch(console.error);
setTimeout(watcher.stop, 50000);