mirror of
https://github.com/LightAir/turbo-rss.git
synced 2026-02-04 12:06:20 +00:00
Мелкие правки
This commit is contained in:
16
lib/index.js
16
lib/index.js
@@ -25,7 +25,6 @@ function generateXML(data) {
|
|||||||
|
|
||||||
item_values.push({link: item.url});
|
item_values.push({link: item.url});
|
||||||
item_values.push({'turbo:source': 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.date, item_values, {pubDate: new Date(item.date).toGMTString()});
|
||||||
ifTruePush(item.author, item_values, {author: item.author});
|
ifTruePush(item.author, item_values, {author: item.author});
|
||||||
@@ -69,30 +68,27 @@ function YTurbo(options, items) {
|
|||||||
this.title = options.title || 'Untitled';
|
this.title = options.title || 'Untitled';
|
||||||
this.description = options.description || '';
|
this.description = options.description || '';
|
||||||
this.link = options.link;
|
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.items = items || [];
|
||||||
|
|
||||||
this.item = function (options) {
|
this.item = function (options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var item = {
|
let item = {
|
||||||
title: options.title || 'No title',
|
title: options.title || 'No title',
|
||||||
description: options.description || '',
|
description: options.description || '',
|
||||||
image_url: options.image_url,
|
image_url: options.image_url,
|
||||||
url: options.url,
|
url: options.url,
|
||||||
author: options.author,
|
author: options.author,
|
||||||
date: options.date,
|
date: options.date || options.pubDate,
|
||||||
content: options.content
|
content: options.content,
|
||||||
|
menu: options.menu
|
||||||
};
|
};
|
||||||
|
|
||||||
this.items.push(item);
|
this.items.push(item);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.xml = function (indent) {
|
this.xml = function () {
|
||||||
return xml(generateXML(this), indent);
|
return xml(generateXML(this));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user