From ba1e3c902feb4e662a6dddaa088eb42481828375 Mon Sep 17 00:00:00 2001 From: Robert DeLuca Date: Mon, 12 Aug 2024 20:33:33 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Look=20for=20`lastBuildDate`=20i?= =?UTF-8?q?f=20`pubDate`=20doesn't=20exist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f99acc3..d7f72be 100755 --- a/index.js +++ b/index.js @@ -60,7 +60,7 @@ export const fetchFeed = async (url, lastPublishedDates) => { return items.map(item => ({ title: item.title, link: item.link, - publishedDate: new Date(item.pubDate).toISOString(), + publishedDate: new Date(item.pubDate || item.lastBuildDate).toISOString(), })).filter(article => { let lastPublished = lastPublishedDates[url]; let isNew = !lastPublished || new Date(article.publishedDate) > new Date(lastPublished);