From 3504b158ac627dc4725d3a0b7f59b897a0520efb Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 17 May 2025 14:03:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/rssPush.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/rssPush.js b/apps/rssPush.js index edfab1e..687dc60 100644 --- a/apps/rssPush.js +++ b/apps/rssPush.js @@ -128,18 +128,23 @@ export default class RssPlugin extends plugin { async pushFeeds(e) { const feeds = configControl.get('feeds') || []; logger.mark(`正在检查rss流更新..`); + for (const feed of feeds) { const latest = await rssTools.fetchFeed(feed.url); if (!latest || !latest.length) continue; + const todayStr = new Date().toISOString().split('T')[0]; const newItems = []; for (const item of latest) { + const pubDate = item.pubDate || item.published || item.date || item.updated; + if (!pubDate) continue; + const itemDate = new Date(pubDate).toISOString().split('T')[0]; + if (itemDate !== todayStr) continue; if (!(await rssCache.has(feed.url, item.link))) { newItems.push(item); } } if (newItems.length) { await rssCache.set(feed.url, newItems[0].link); - for (const groupId of feed.targetGroups) { const post = newItems[0]; const tempPath = path.join(process.cwd(), 'data', `rss-${Date.now()}.png`);