Skip to content

Commit

Permalink
πŸ› Look for lastBuildDate if pubDate doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Robdel12 committed Aug 13, 2024
1 parent 6c8180a commit ba1e3c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ba1e3c9

Please sign in to comment.