get-rss-atom
Advanced tools
Comparing version 1.0.2 to 1.0.3-a
15
get.js
@@ -12,3 +12,2 @@ 'use strict'; | ||
host: feed.hostname, | ||
port: feed.port, | ||
path: feed.path | ||
@@ -73,14 +72,8 @@ }; | ||
const parser = function (res) { | ||
if (res.statusCode === 200) { | ||
let content = ''; | ||
res.on('data', chunk => content += chunk); | ||
res.on('end', () => { | ||
callback(extractItems(content)) | ||
}); | ||
} else { | ||
console.error(`No content, response code was: ${res.statusCode}`) | ||
} | ||
let content = ''; | ||
res.on('data', chunk => content += chunk); | ||
res.on('end', () => callback(extractItems(content))); | ||
}; | ||
if (feed.port === '80') { | ||
if (feed.protocol === 'http:') { | ||
http.get(options, parser).on('error', e => { | ||
@@ -87,0 +80,0 @@ console.error(e.message) |
{ | ||
"name": "get-rss-atom", | ||
"version": "1.0.2", | ||
"version": "1.0.3a", | ||
"description": "Reed feed content from URL and return Array with Objects", | ||
"main": "get.js", | ||
"scripts": { | ||
"test": "node test.js http://rss.fok.nl/feeds/nieuws || exit 1" | ||
"test": "echo 'no test yet' && exit 1" | ||
}, | ||
@@ -9,0 +9,0 @@ "author": "Niels Koster", |
Simple RSS/ATOM feed parser. | ||
WIP: this is an attempt to create a new generic library since other libraries have failed, at least for me. | ||
`getRssAtom(url)` returns a callback with an object array. | ||
Usage: | ||
### Install | ||
`node get.js -host www.geenstijl.nl -port 443 -path /feeds/recent.atom` | ||
``` | ||
npm init | ||
npm install --save get-rss-atom | ||
``` | ||
or | ||
### Usage | ||
`node get.js -host www.at5.nl -path /feeds/at5/nieuws/V100/nieuws` | ||
For example, create `test.js` | ||
``` | ||
test = require('get-rss-atom/get'); | ||
let | ||
count = 0; | ||
hostFeed = ''; | ||
if (process.argv.length > 1) { | ||
hostFeed = process.argv[2] | ||
} | ||
test.getRssAtom(hostFeed, content => content.forEach((item) => { | ||
count++; | ||
console.log( | ||
`\n--${count}-- ${item.title}\n${item.description}\n${item.href}\n` | ||
) | ||
})); | ||
``` | ||
### Run | ||
``` | ||
node test.js http://www.at5.nl/feeds/at5/nieuws/V100/nieuws | ||
``` |
@@ -1,2 +0,2 @@ | ||
test = require('./get'); | ||
test = require('get-rss-son/get'); | ||
@@ -3,0 +3,0 @@ let |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
6984
178
40
1
3
5