Socket
Socket
Sign inDemoInstall

rss-parser

Package Overview
Dependencies
4
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.0 to 2.1.1

19

index.js

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

var Request = require('request');
var HTTP = require('http');
var HTTPS = require('https');

@@ -52,7 +53,15 @@ var Parser = module.exports = {};

Parser.parseURL = function(url, callback) {
Request(url, function(err, resp, body) {
if (err) return callback(err);
if (resp.statusCode !== 200) return callback(new Error('Status code is: ' + resp.statusCode))
return Parser.parseString(body, callback);
var xml = '';
var get = url.indexOf('https') === 0 ? HTTPS.get : HTTP.get;
var req = get(url, function(res) {
if (res.statusCode >= 300) return callback(new Error("Status code " + res.statusCode))
res.setEncoding('utf8');
res.on('data', function(chunk) {
xml += chunk;
});
res.on('end', function() {
return Parser.parseString(xml, callback);
})
})
req.on('error', callback);
}

@@ -59,0 +68,0 @@

{
"name": "rss-parser",
"version": "2.1.0",
"version": "2.1.1",
"main": "index.js",

@@ -17,3 +17,2 @@ "scripts": {

"entities": "^1.1.1",
"request": "^2.67.0",
"xml2js": "^0.4.15"

@@ -20,0 +19,0 @@ },

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc