New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rssparser

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rssparser - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

80

lib/feed.js

@@ -1,2 +0,2 @@

//feed.js
//feed.js
var xml2js = require('xml2js');

@@ -26,7 +26,9 @@ var _ = require('underscore');

var req = request(options, function (err, response, xml) {
if (err || xml === null) {
if (response.statusCode >= 400) {
callback("Failed to retrieve source! Invalid response code (" + response.statusCode + ")!", null);
} else if (err || xml === null) {
if (err) {
callback(err, null);
} else {
callback('failed to retrive source', null);
callback('Failed to retrieve source!', null);
}

@@ -100,6 +102,3 @@ } else {

function formatRSS(json) {
//var output = {'type':'rss', metadata:{}, items:[]};
//Start with the metadata for the feed
var output = {'type': 'rss', items: []};
var metadata = {};
var channel = json.channel;

@@ -160,3 +159,3 @@

//now lets handel the GUID
//now lets handle the GUID
if (val.guid) {

@@ -169,2 +168,12 @@ //xml2js parses this kina odd...

}
if (val['media:content']) {
obj.media = val.media || {};
obj.media.content = val['media:content'];
}
if (val['media:thumbnail']) {
obj.media = val.media || {};
obj.media.thumbnail = val['media:thumbnail'];
}
//now push the obj onto the stack

@@ -180,30 +189,28 @@ output.items.push(obj);

var output = {'type': 'atom', items: []};
//Start with the metadata for the feed
var metadata = {};
var channel = json.feed;
if (typeof channel.title === "object") {
console.log(channel.title);
}
if (channel.title) {
output.title = channel.title[0]._;
}
if (_.isArray(channel.subtitle)) {
if (channel.subtitle[0]._) {
output.desc = channel.subtitle[0]._;
if (channel.subtitle)
if (_.isArray(channel.subtitle)) {
if (channel.subtitle[0]._) {
output.desc = channel.subtitle[0]._;
}
} else {
output.desc = channel.subtitle;
}
} else {
output.desc = channel.subtitle;
}
if (_.isArray(channel.link)) {
_.each(channel.link, function (val, index) {
if (channel.link)
if (_.isArray(channel.link)) {
_.each(channel.link, function (val, index) {
if (val.type && val.type.indexOf("html") > 0) {
output.link = val.href;
}
if (val.rel === "hub") {
output.hub = val.href;
}
});
}
if (val.type && val.type.indexOf("html") > 0) {
output.link = val.href;
}
if (val.rel === "hub") {
output.hub = val.href;
}
});
}

@@ -232,3 +239,3 @@ if (channel.id) {

if (!val.title) {
console.log(json);
// console.log(json);
}

@@ -271,2 +278,11 @@ obj.title = val.title[0]._;

}
if (val['media:content']) {
obj.media = val.media || {};
obj.media.content = val['media:content'];
}
if (val['media:thumbnail']) {
obj.media = val.media || {};
obj.media.thumbnail = val['media:thumbnail'];
}
//now push the obj onto the stack

@@ -282,3 +298,3 @@ output.items.push(obj);

// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing:function (from) {
time_ago_in_words_with_parsing: function (from) {
var date = new Date();

@@ -290,7 +306,7 @@ date.setTime(Date.parse(from));

// DateHelper.time_ago_in_words(1331079503000)
time_ago_in_words:function (from) {
time_ago_in_words: function (from) {
return this.distance_of_time_in_words(new Date(), from);
},
distance_of_time_in_words:function (to, from) {
distance_of_time_in_words: function (to, from) {
var distance_in_seconds = ((to - from) / 1000);

@@ -297,0 +313,0 @@ var distance_in_minutes = Math.floor(distance_in_seconds / 60);

74

npm-shrinkwrap.json
{
"name": "rssparser",
"version": "0.0.2",
"version": "0.0.3",
"dependencies": {
"xml2js": {
"version": "0.2.0",
"version": "0.2.6",
"dependencies": {

@@ -14,9 +14,71 @@ "sax": {

"request": {
"version": "2.9.3"
"version": "2.16.6",
"dependencies": {
"form-data": {
"version": "0.0.7",
"dependencies": {
"combined-stream": {
"version": "0.0.4",
"dependencies": {
"delayed-stream": {
"version": "0.0.5"
}
}
},
"async": {
"version": "0.1.22"
}
}
},
"mime": {
"version": "1.2.9"
},
"hawk": {
"version": "0.10.2",
"dependencies": {
"hoek": {
"version": "0.7.6"
},
"boom": {
"version": "0.3.8"
},
"cryptiles": {
"version": "0.1.3"
},
"sntp": {
"version": "0.1.4"
}
}
},
"node-uuid": {
"version": "1.4.0"
},
"cookie-jar": {
"version": "0.2.0"
},
"aws-sign": {
"version": "0.2.0"
},
"oauth-sign": {
"version": "0.2.0"
},
"forever-agent": {
"version": "0.2.0"
},
"tunnel-agent": {
"version": "0.2.0"
},
"json-stringify-safe": {
"version": "3.0.0"
},
"qs": {
"version": "0.5.5"
}
}
},
"underscore": {
"version": "1.3.3"
"version": "1.4.4"
},
"vows": {
"version": "0.6.4",
"version": "0.7.0",
"dependencies": {

@@ -27,3 +89,3 @@ "eyes": {

"diff": {
"version": "1.0.3"
"version": "1.0.4"
}

@@ -30,0 +92,0 @@ }

{
"name": "rssparser",
"version": "0.0.2",
"description": "rssparser is an all purpose RSS/ATOM feed parser that parses feeds into a JSON format.",
"keywords": [
"rss",
"atom",
"feed",
"parser"
],
"repository": {
"type": "git",
"url": "http://github.com/tk120404/node-rssparser.git"
},
"dependencies": {
"xml2js": "0.2.0",
"request": "2.9.3",
"underscore": "1.3.3"
},
"devDependencies": {
"vows": "*"
},
"scripts": {
"test": "vows --spec"
},
"main": "./lib/feed.js",
"readme": "node-rssparser",
"readmeFilename": "README.md",
"_id": "rssparser@0.0.2",
"_from": "rssparser"
"name": "rssparser",
"version": "0.0.3",
"description": "rssparser is an all purpose RSS/ATOM feed parser that parses feeds into a JSON format.",
"keywords": [
"rss",
"atom",
"feed",
"parser"
],
"repository": {
"type": "git",
"url": "http://github.com/tk120404/node-rssparser.git"
},
"dependencies": {
"xml2js": ">=0.2.0",
"request": ">=2.9.3",
"underscore": ">=1.3.3"
},
"devDependencies": {
"vows": "*"
},
"scripts": {
"test": "vows --spec"
},
"main": "./lib/feed.js",
"readme": "node-rssparser",
"readmeFilename": "README.md",
"_id": "rssparser@0.0.3",
"_from": "rssparser"
}

@@ -73,1 +73,13 @@ node-rssparser

Change log
----------
0.0.3 thumbnails added
0.0.2 atom parser changes
0.0.1 initial
License
-------
http://wtfpl.org/

@@ -21,3 +21,2 @@ // string test.js

assert.equal(docs.type, 'rss');
assert.isObject(docs.metadata);
assert.isArray(docs.items);

@@ -36,3 +35,2 @@ }

assert.equal(docs.type, 'atom');
assert.isObject(docs.metadata);
assert.isArray(docs.items);

@@ -51,3 +49,2 @@ }

assert.equal(docs.type, 'rss');
assert.isObject(docs.metadata);
assert.isArray(docs.items);

@@ -54,0 +51,0 @@ }

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