hook.io-feedsub
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -5,3 +5,3 @@ { | ||
"keywords": ["hook.io", "feed", "rss", "atom", "subscribe"], | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"repository": { | ||
@@ -13,2 +13,5 @@ "type": "git", | ||
"main": "./lib/feed.js", | ||
"scripts": { | ||
"test": "vows test/test.js --spec" | ||
}, | ||
"bin": { | ||
@@ -24,2 +27,6 @@ "hookio-feed": "./bin/feed" | ||
}, | ||
"devDependencies": { | ||
"vows": "0.5.x", | ||
"nock": "0.3.x" | ||
}, | ||
"licenses": [ { | ||
@@ -26,0 +33,0 @@ "type": "MIT", |
@@ -1,24 +0,55 @@ | ||
Install | ||
------------ | ||
Will "subscribe" to a web RSS/Atom feed and emit any new items it reads from it. The events are in the form of | ||
npm -g install hook.io-feedsub | ||
`*::name::item` | ||
Where `name` is the name of the feed. So if you are using the example [`config.json`](/fent/hook.io-feedsub/tree/master/examples/config.json) that looks like this | ||
Usage | ||
------------------ | ||
```javascript | ||
{ | ||
"feeds": [ | ||
{ | ||
"name": "cnn", | ||
"url": "http://rss.cnn.com/rss/cnn_latest.rss", | ||
"interval": 10, | ||
"emitOnStart": false | ||
} | ||
] | ||
} | ||
``` | ||
hookio-feedsub | ||
Will "subscribe" to a web feed and emit any new items it reads from it. Take a look at the `config.json` file to see how to structure it. The events emitted will be in the form of | ||
Programatically, this is how you would listen for new feed items.. | ||
`*::name::item` | ||
Where `name` is the name of the feed. So if you are using the example `config.json` file and waiting for the latest news from CNN, programatically, you would want to do.. | ||
```javascript | ||
hook.on('*::cnn:item', function(item) { | ||
console.log('New Story!:', item.title); | ||
} | ||
}); | ||
``` | ||
It uses [feedsub](https://github.com/fent/node-feedsub) to read feeds. Take a look at its constructor API for all the options that can be passed to it. | ||
Usage | ||
------------------ | ||
```bash | ||
hookio-feedsub | ||
``` | ||
Install | ||
------------ | ||
```bash | ||
npm -g install hook.io-feedsub | ||
``` | ||
Tests | ||
--------- | ||
The single test is written with [vows](http://vowsjs.org/) | ||
```bash | ||
npm test | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
46222
10
97
56
2