rss-parser
Advanced tools
Comparing version 3.7.2 to 3.7.3
@@ -5,4 +5,4 @@ import { Options } from 'xml2js'; | ||
export interface Headers { | ||
readonly Accept: string; | ||
readonly 'User-Agent': string; | ||
readonly Accept?: string; | ||
readonly 'User-Agent'?: string; | ||
} | ||
@@ -21,2 +21,3 @@ | ||
readonly customFields?: CustomFields; | ||
readonly timeout?: number; | ||
} | ||
@@ -23,0 +24,0 @@ |
@@ -224,4 +224,3 @@ "use strict"; | ||
decorateItunes(feed, channel) { | ||
let items = channel.item || [], | ||
entry = {}; | ||
let items = channel.item || []; | ||
let categories = []; | ||
@@ -231,4 +230,3 @@ feed.itunes = {} | ||
if (channel['itunes:owner']) { | ||
let owner = {}, | ||
image; | ||
let owner = {}; | ||
@@ -241,13 +239,15 @@ if(channel['itunes:owner'][0]['itunes:name']) { | ||
} | ||
if(channel['itunes:image']) { | ||
let hasImageHref = (channel['itunes:image'][0] && | ||
channel['itunes:image'][0].$ && | ||
channel['itunes:image'][0].$.href); | ||
image = hasImageHref ? channel['itunes:image'][0].$.href : null; | ||
} | ||
feed.itunes.owner = owner; | ||
} | ||
if(image) { | ||
if (channel['itunes:image']) { | ||
let image; | ||
let hasImageHref = (channel['itunes:image'][0] && | ||
channel['itunes:image'][0].$ && | ||
channel['itunes:image'][0].$.href); | ||
image = hasImageHref ? channel['itunes:image'][0].$.href : null; | ||
if (image) { | ||
feed.itunes.image = image; | ||
} | ||
feed.itunes.owner = owner; | ||
} | ||
@@ -262,3 +262,7 @@ | ||
if(channel['itunes:keywords']) { | ||
feed.itunes.keywords = channel['itunes:keywords'][0].split(","); | ||
let keywords=channel['itunes:keywords'][0]; | ||
if(keywords && typeof keywords._ === 'string'){ | ||
keywords=keywords._ | ||
} | ||
if(keywords)feed.itunes.keywords = keywords.split(","); | ||
} | ||
@@ -265,0 +269,0 @@ utils.copyFromXML(channel, feed.itunes, fields.podcastFeed); |
@@ -45,4 +45,8 @@ const utils = module.exports = {}; | ||
const { keepArray } = options; | ||
if (xml[from] !== undefined) | ||
if (xml[from] !== undefined){ | ||
dest[to] = keepArray ? xml[from] : xml[from][0]; | ||
} | ||
if (dest[to] && typeof dest[to]._ === 'string') { | ||
dest[to]=dest[to]._; | ||
} | ||
}) | ||
@@ -49,0 +53,0 @@ } |
{ | ||
"name": "rss-parser", | ||
"version": "3.7.2", | ||
"version": "3.7.3", | ||
"main": "index.js", | ||
@@ -21,3 +21,4 @@ "types": "index.d.ts", | ||
"puppeteer": "^1.16.0", | ||
"webpack": "^3.12.0" | ||
"webpack": "^4.41.0", | ||
"webpack-cli": "^3.3.9" | ||
}, | ||
@@ -24,0 +25,0 @@ "dependencies": { |
@@ -61,2 +61,3 @@ # rss-parser | ||
parser.parseURL(CORS_PROXY + 'https://www.reddit.com/.rss', function(err, feed) { | ||
if (err) throw err; | ||
console.log(feed.title); | ||
@@ -63,0 +64,0 @@ feed.items.forEach(function(entry) { |
@@ -41,3 +41,2 @@ { | ||
"itunes": { | ||
"image": "https://www.narro.co/images/narro-icon-lg.png", | ||
"owner": { | ||
@@ -47,2 +46,3 @@ "name": "foobar", | ||
}, | ||
"image": "https://www.narro.co/images/narro-icon-lg.png", | ||
"author": "foobar@gmail.com", | ||
@@ -49,0 +49,0 @@ "subtitle": "foobar uses Narro to create a podcast of articles transcribed to audio.", |
@@ -239,5 +239,2 @@ "use strict"; | ||
it('should respect timeout option', function(done) { | ||
var INPUT_FILE = __dirname + '/input/encoding.rss'; | ||
var OUTPUT_FILE = __dirname + '/output/encoding.json'; | ||
var ENCODING = 'latin1'; | ||
var server = HTTP.createServer(function(req, res) {}); | ||
@@ -263,2 +260,6 @@ server.listen(function() { | ||
}); | ||
it('should parse giantbomb-podcast', function(done) { | ||
testParseForFile('giantbomb-podcast', 'rss', done); | ||
}); | ||
}) |
var webpack = require("webpack"); | ||
module.exports = { | ||
entry: { | ||
"rss-parser": "./browser.js" | ||
"rss-parser": "./index.js" | ||
}, | ||
output: { | ||
path: __dirname, | ||
filename: "dist/[name].min.js" | ||
filename: "dist/[name].js", | ||
libraryTarget: 'umd', | ||
globalObject: 'this', | ||
library: 'RSSParser' | ||
}, | ||
@@ -15,3 +18,3 @@ resolve: { | ||
module: { | ||
loaders: [{ | ||
rules: [{ | ||
test: /\.js$/, | ||
@@ -21,2 +24,5 @@ loader: 'babel-loader?presets[]=env', | ||
}, | ||
externals: { | ||
xmlbuilder:'xmlbuilder' | ||
}, | ||
node: { | ||
@@ -23,0 +29,0 @@ fs: "empty" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
7177896
67
41024
230
10
1
11
7