From 72b65e9c25ae3bedbfc6061ab768cc9f187fcd63 Mon Sep 17 00:00:00 2001 From: la Date: Thu, 26 Apr 2018 13:30:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/index.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/index.js b/lib/index.js index d683470..e735a37 100755 --- a/lib/index.js +++ b/lib/index.js @@ -25,7 +25,6 @@ function generateXML(data) { item_values.push({link: item.url}); item_values.push({'turbo:source': item.url}); - // item_values.push({'turbo:topic': item.title}); ifTruePush(item.date, item_values, {pubDate: new Date(item.date).toGMTString()}); ifTruePush(item.author, item_values, {author: item.author}); @@ -69,30 +68,27 @@ function YTurbo(options, items) { this.title = options.title || 'Untitled'; this.description = options.description || ''; this.link = options.link; - this.image_url = options.image_url; - this.author = options.author; - this.content = options.content; - this.pubDate = options.pubDate; this.items = items || []; this.item = function (options) { options = options || {}; - var item = { + let item = { title: options.title || 'No title', description: options.description || '', image_url: options.image_url, url: options.url, author: options.author, - date: options.date, - content: options.content + date: options.date || options.pubDate, + content: options.content, + menu: options.menu }; this.items.push(item); return this; }; - this.xml = function (indent) { - return xml(generateXML(this), indent); + this.xml = function () { + return xml(generateXML(this)); }; }