diff --git a/test/test.ts b/test/test.ts index c1b02ff..40b563e 100644 --- a/test/test.ts +++ b/test/test.ts @@ -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); diff --git a/ts/smartfeed.classes.feed.ts b/ts/smartfeed.classes.feed.ts index b3966d0..66bf6c3 100644 --- a/ts/smartfeed.classes.feed.ts +++ b/ts/smartfeed.classes.feed.ts @@ -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 }]