From 27ed33dcd3f8ebf7e7643e8d5bb3ca12990e9cbb Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 19 May 2025 16:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/rssPush.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/rssPush.js b/apps/rssPush.js index baf4a22..e57f600 100644 --- a/apps/rssPush.js +++ b/apps/rssPush.js @@ -31,7 +31,7 @@ export default class RssPlugin extends plugin { priority: 100, }, { - reg: /(https?:\/\/[^\s]+(?:\.atom|\/feed))/i, + reg: /(https?:\/\/\S+(?:\.atom|\/feed))/i, fnc: 'autoAddFeed', permission: 'master', priority: 500, @@ -76,7 +76,7 @@ export default class RssPlugin extends plugin { */ async autoAddFeed(e) { //if (/^#rss/i.test(e.msg.trim())) return false; - const url = e.msg.match(/(https?:\/\/[^\s]+(?:\.atom|\/feed))/i)?.[1]; + const url = e.msg.match(/(https?:\/\/\S+(?:\.atom|\/feed))/i)?.[1]; if (!url) return false; e.msg = `#rss添加 ${url}`; return await this.addFeed(e); @@ -123,10 +123,9 @@ export default class RssPlugin extends plugin { /** * 检查rss更新 - * @param e * @returns {Promise} */ - async pushFeeds(e) { + async pushFeeds() { const feeds = configControl.get('feeds') || []; logger.mark(`正在检查rss流更新..`); @@ -136,7 +135,7 @@ export default class RssPlugin extends plugin { 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; + const pubDate = item.date; if (!pubDate) continue; const itemDate = new Date(pubDate).toISOString().split('T')[0]; if (itemDate !== todayStr) continue;