URL Poller
A fully customizable url poller and notifier
Features
- polls multiple urls
- customizable poll interval
- creates a diff between the previous and current version upon changes
- handles HTTP authentication and any other option from
the request library
- emits changes and notifies using RxJS
giving you lots of possibilities to fit your needs
Installation
npm install multiple-url-poller
Example
const Poller = require('multiple-url-poller').Poller;
let interval = 5 * 1000;
let urls = ['https://time.is/'];
let poller = new Poller({ interval, urls });
let diffs$ = poller.getDiffObservable();
let subscription = diffs$
.map(diffs => diffs.filter(singleDiff => singleDiff.added || singleDiff.removed))
.subscribe(diffs => console.log('New diff', diffs));
poller.start();
See it running in your browser
Contributing
If you would like to suggest a feature or report a problem please use the Issues tab on GitHub.
All pull requests are welcome! Before creating one, make sure there are no problems by running
the following commands:
npm run lint
npm test
Creating unit tests for new features in your pull requests would also be splendid, although it is
not required.
Author
The author of this project is Grzegorz Rozdzialik.