fix(core): update

This commit is contained in:
Philipp Kunz 2020-11-11 10:11:18 +00:00
parent b0719c481e
commit 599af94709
2 changed files with 8 additions and 4 deletions

View File

@ -23,7 +23,8 @@ tap.test('should create a feed', async () => {
authorName: 'Phil',
imageUrl: 'https://central.eu/someimage.png',
timestamp: Date.now(),
url: 'https://central.eu/article/somearticle'
url: 'https://central.eu/article/somearticle',
content: 'somecontent'
});
const rssFeed = feed.exportRssFeedString();
console.log(rssFeed);

View File

@ -16,6 +16,7 @@ export interface IFeedItem {
url: string;
authorName: string;
imageUrl: string;
content: string;
}
export class Feed {
@ -32,7 +33,8 @@ export class Feed {
private getFeedObject() {
const feed = new plugins.feed.Feed({
copyright: `All rights reserved, ${this.options.company}`,
id: this.options.domain,
id: `https://${this.options.domain}`,
link: `https://${this.options.domain}`,
title: this.options.title,
author: {
name: this.options.company,
@ -49,8 +51,9 @@ export class Feed {
feed.addItem({
title: itemArg.title,
date: new Date(itemArg.timestamp),
link: itemArg.url,
image: itemArg.imageUrl,
link: itemArg.url.replace(/&/gm, '&'),
image: itemArg.imageUrl.replace(/&/gm, '&'),
content: itemArg.content,
author: [{
name: itemArg.authorName
}]