get-rss-atom
Advanced tools
Comparing version 1.0.1 to 1.0.2-a
20
get.js
'use strict'; | ||
exports.getRssAtom = function(feedUrl) { | ||
exports.getRssAtom = function(feedUrl, callback) { | ||
@@ -72,11 +72,11 @@ const | ||
const parser = function (res) { | ||
let content = '', count = 0; | ||
res.on('data', chunk => content += chunk); | ||
res.on('end', () => { | ||
extractItems(content).forEach((item) => { | ||
count++; | ||
console.log(`\n--${count}-- ${item.title}\n${item.description}\n${item.href}\n`) | ||
}) | ||
}); | ||
console.log(`Got response: ${res.statusCode}`) | ||
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}`) | ||
} | ||
}; | ||
@@ -83,0 +83,0 @@ |
{ | ||
"name": "get-rss-atom", | ||
"version": "1.0.1", | ||
"description": "Get RSS from URL and return JSON (not ready yet)", | ||
"version": "1.0.2a", | ||
"description": "Reed feed content from URL and return Array with Objects", | ||
"main": "get.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo 'no test yet' && exit 1" | ||
}, | ||
"author": "Niels Koster", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"dependencies": {} | ||
} |
15
test.js
@@ -1,3 +0,14 @@ | ||
t = require('./get'); | ||
test = require('get-rss-son/get'); | ||
t.getRssAtom('https://www.geenstijl.nl/feeds/recent.atom'); | ||
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`) | ||
})); |
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
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
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
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
3900
95
3
3