Comparing version 0.1.0 to 0.1.1
@@ -1,3 +0,7 @@ | ||
var xml = require('xml'); | ||
var xml = require('xml'); | ||
var moment = require('moment'); | ||
// ============================================================================ | ||
// Feed Main Module | ||
// ============================================================================ | ||
function Feed(options, items) { | ||
@@ -7,5 +11,5 @@ this.title = options.title; | ||
this.link = options.link; | ||
this.author = options.author; | ||
this.copyright = options.copyright; | ||
this.language = options.language; // fr-CA, en-US... | ||
//this.author = options.author; | ||
//this.copyright = options.copyright; | ||
//this.language = options.language; // fr-CA, en-US... | ||
this.items = items || []; | ||
@@ -19,3 +23,3 @@ | ||
description: options.description, | ||
author: options.author | ||
date: options.date | ||
}; | ||
@@ -39,2 +43,5 @@ | ||
// ============================================================================ | ||
// Real Simple Syndication 2.0 (RSS 2.0) | ||
// ============================================================================ | ||
function rss20(options) { | ||
@@ -50,3 +57,3 @@ var items = []; | ||
// Required RSS 2.0 channel ellements | ||
// Required RSS 2.0 channel elements | ||
channel.push({ title: options.title }); | ||
@@ -56,6 +63,8 @@ channel.push({ description: options.description }); | ||
// Required RSS 2.0 item elements | ||
for(item in options.items) { | ||
channel.push({ item: [ | ||
{ title: options.items[item].title }, | ||
{ title: { _cdata: options.items[item].title }}, | ||
{ link: options.items[item].link }, | ||
{ pubDate: moment(options.items[item].date).format("ddd, DD MMM YYYY HH:mm:ss ") + 'GMT' }, | ||
{ description: { _cdata: options.items[item].description }} | ||
@@ -65,5 +74,6 @@ ]}); | ||
return xml(rss, true); | ||
return '<?xml version="1.0"?>\n' + | ||
xml(rss, true); | ||
} | ||
module.exports = Feed; |
{ | ||
"name": "feed", | ||
"version": "0.1.0", | ||
"description": "Feed Wrapper. Simplest content syndication wrapper for Atom and RSS 2.0.", | ||
"version": "0.1.1", | ||
"description": "Feed is the simplest content syndication wrapper for Atom and RSS 2.0.", | ||
"homepage": "https://github.com/jpmonette/feed", | ||
"author": "Jean-Philippe Monette", | ||
"keywords": [ | ||
"xml", | ||
"rss", | ||
"atom", | ||
"feed", | ||
"syndication" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/jpmonette/feed/issues" | ||
}, | ||
"main": "lib/feed.js", | ||
"dependencies": { | ||
"xml": ">= 0.0.5" | ||
"xml": ">= 0.0.5", | ||
"moment": ">= 1.5.0" | ||
}, | ||
@@ -16,7 +29,8 @@ "engines": { | ||
}, | ||
"repository": | ||
{ | ||
"type": "git", | ||
"url": "https://github.com/jpmonette/feed" | ||
} | ||
"repository": | ||
{ | ||
"type": "git", | ||
"url": "https://github.com/jpmonette/feed" | ||
} | ||
} |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
2774
62
0
2
+ Addedmoment@>= 1.5.0
+ Addedmoment@2.30.1(transitive)