Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rss-parser

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rss-parser - npm Package Compare versions

Comparing version 2.5.2 to 2.6.0

LICENSE

55

index.js

@@ -40,3 +40,4 @@ var Entities = require("entities");

'explicit',
'duration'
'duration',
'image'
];

@@ -146,14 +147,24 @@

entry = {};
json.feed.itunes = {}
if (channel['itunes:owner']) {
json.feed.itunes = {
owner: {
name: channel['itunes:owner'][0]['itunes:name'][0],
email: channel['itunes:owner'][0]['itunes:email'][0]
},
image: channel['itunes:image'][0].$.href
};
} else {
json.feed.itunes = {}
var owner = {},
image;
if(channel['itunes:owner'][0]['itunes:name']) {
owner.name = channel['itunes:owner'][0]['itunes:name'][0];
}
if(channel['itunes:owner'][0]['itunes:email']) {
owner.email = channel['itunes:owner'][0]['itunes:email'][0];
}
if(channel['itunes:image']) {
image = channel['itunes:image'][0].$.href
}
if(image) {
json.feed.itunes.image = image;
}
json.feed.itunes.owner = owner;
}
PODCAST_TOP_FIELDS.forEach(function(f) {

@@ -166,3 +177,9 @@ if (channel['itunes:' + f]) json.feed.itunes[f] = channel['itunes:' + f][0];

entry.itunes = entry.itunes || {};
if (item['itunes:' + f]) entry.itunes[f] = item['itunes:' + f][0];
if (item['itunes:' + f]) {
if (f == 'image' && item['itunes:' + f][0].$ && item['itunes:' + f][0].$.href) {
entry.itunes[f] = item['itunes:' + f][0].$.href;
} else {
entry.itunes[f] = item['itunes:' + f][0];
}
}
});

@@ -186,3 +203,10 @@ json.feed.entries[index] = entry;

Parser.parseURL = function(feedUrl, callback) {
Parser.parseURL = function(feedUrl, settings, callback) {
if (!callback) {
callback = settings;
settings = {};
}
settings.__redirectCount = settings.__redirectCount || 0;
if (settings.maxRedirects === undefined) settings.maxRedirects = 1;
var xml = '';

@@ -197,3 +221,8 @@ var get = feedUrl.indexOf('https') === 0 ? HTTPS.get : HTTP.get;

}, function(res) {
if (res.statusCode >= 300) return callback(new Error("Status code " + res.statusCode))
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers['location']) {
if (settings.maxRedirects === 0) return callback(new Error("Status code " + res.statusCode));
if (settings.__redirectCount === settings.maxRedirects) return callback(new Error("Too many redirects"));
settings.__redirectCount++;
return Parser.parseURL(res.headers['location'], settings, callback);
}
res.setEncoding('utf8');

@@ -200,0 +229,0 @@ res.on('data', function(chunk) {

{
"name": "rss-parser",
"version": "2.5.2",
"version": "2.6.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -61,2 +61,3 @@ # rss-parser

grunt browserify
git commit -a -m "browserify"
npm version minor # or major/patch

@@ -63,0 +64,0 @@ npm publish

@@ -22,3 +22,4 @@ {

"explicit": "no",
"duration": "74"
"duration": "74",
"image": "http://example.com/someImage.jpg"
}

@@ -25,0 +26,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc