Skip to content

A Simple Watcher for RSS Feeds emitting "data"event on new entries.

License

Notifications You must be signed in to change notification settings

PharaStarLLC/rss-feed-watcher

Repository files navigation

@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);

About

A Simple Watcher for RSS Feeds emitting "data"event on new entries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published