get-rss-atom
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -76,3 +76,3 @@ 'use strict'; | ||
let t = getTitle(content.toString()); | ||
return { title: t, items: getItems(content.toString(), 'item') | ||
return { title: t, href: feedUrl, items: getItems(content.toString(), 'item') | ||
.concat(getItems(content.toString(), 'entry')) } | ||
@@ -83,2 +83,3 @@ } | ||
let content = ''; | ||
res.setEncoding('utf8'); | ||
res.on('data', chunk => content += chunk); | ||
@@ -85,0 +86,0 @@ res.on('end', () => callback(extractItems(content))); |
{ | ||
"name": "get-rss-atom", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Reed feed content from URL and return Array with Objects", | ||
@@ -13,2 +13,3 @@ "main": "get.js", | ||
}, | ||
"keywords": ["rss", "atom"], | ||
"author": "Niels Koster", | ||
@@ -15,0 +16,0 @@ "license": "MIT", |
@@ -5,3 +5,3 @@ Simple RSS/ATOM feed parser. | ||
``` | ||
~~~javascript | ||
{ | ||
@@ -18,23 +18,33 @@ title: String, | ||
} | ||
``` | ||
~~~ | ||
### Install | ||
``` | ||
npm init | ||
~~~bash | ||
npm install --save get-rss-atom | ||
``` | ||
~~~ | ||
### Usage | ||
For example, create `reader.js` | ||
An example reader: | ||
``` | ||
reader = require('get-rss-atom'); | ||
~~~bash | ||
mkdir reader | ||
cd reader | ||
npm init -y | ||
npm install --save get-rss-atom | ||
~~~ | ||
Create `reader.js` | ||
~~~javascript | ||
'use strict'; | ||
const reader = require('get-rss-atom'); | ||
let | ||
count = 0; | ||
count = 0, | ||
feedUrl = ''; | ||
if (process.argv.length > 1) { | ||
if (process.argv.length > 2) { | ||
feedUrl = process.argv[2] | ||
@@ -50,11 +60,11 @@ } else { | ||
count++; | ||
console.log(`\n--${count}-- ${item.title}\n${item.content}\n${item.href}\n`) | ||
} | ||
)}); | ||
``` | ||
console.log(`\n--${count}-- ${item.title} (${item.href})\n${item.content}\n${item.href}\n`) | ||
}) | ||
}); | ||
~~~ | ||
### Run | ||
Run: | ||
``` | ||
~~~bash | ||
node reader http://www.at5.nl/feeds/at5/nieuws/V100/nieuws | ||
``` | ||
~~~ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4836
89
68