https://github.com/pradel/feed-sub
Tracks rss/atom feeds and get notified when they are updated.
https://github.com/pradel/feed-sub
Last synced: 9 months ago
JSON representation
Tracks rss/atom feeds and get notified when they are updated.
- Host: GitHub
- URL: https://github.com/pradel/feed-sub
- Owner: pradel
- License: mit
- Created: 2016-11-30T15:03:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-01T17:48:48.000Z (over 9 years ago)
- Last Synced: 2025-09-22T03:55:43.388Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# feed-sub
Tracks rss/atom feeds and get notified when they are updated.
[](https://travis-ci.org/pradel/feed-sub)
## Install
`npm install --save feed-sub`
`yarn add feed-sub`
## Usage
```javascript
import FeedSub from 'feed-sub';
const feed = new FeedSub([
'https://github.com/facebook/react/tags.atom',
'https://github.com/facebook/jest/tags.atom',
]);
// An item was updated
feed.on('update', (data) => {
console.log(data);
});
// handle stream error
feed.on('error', (err) => {
// An error occur
console.log(err);
});
feed.start();
```
## Api
###`const feed = new FeedSub(urls, [options])`
Create a new `FeedSub` instance.
* `urls` - array - Array of urls.
* `options.interval` - number - Number of seconds between two checks.
###`feed.start()`
Start to stream.
###`feed.stop()`
Stop the stream.