Skip to content

Commit

Permalink
fix duplicate image
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstrema committed Aug 13, 2024
1 parent 289a93f commit 276d44a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ async function extractFromItem(item: Element) {
id: fullLink,
link: fullLink,
description: content?.textContent || 'No content',
content: image?.src ? image.outerHTML + content?.outerHTML : content?.outerHTML,
image: image?.src,
content: content?.outerHTML,
date: new Date(date?.textContent || Date.now()), // TODO: extract date from the item
})
}
Expand All @@ -82,6 +82,8 @@ newsLists.forEach((newsList) => {
})
await Promise.all(promises)

console.log(`found ${feed.items.length} items`)

Bun.write("./dist/rss.xml", feed.rss2())
Bun.write("./dist/feed.json", feed.json1())
Bun.write("./dist/atom.xml", feed.atom1())

0 comments on commit 276d44a

Please sign in to comment.