From 345c020dea59f95c7d149dc02b6bf93b197b050b Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Sun, 17 Jul 2022 12:36:52 +0800 Subject: [PATCH 1/2] fix not saving loqseq weekly newsletter due to no url --- packages/api/src/utils/parser.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/api/src/utils/parser.ts b/packages/api/src/utils/parser.ts index 7704ac233..f8716978e 100644 --- a/packages/api/src/utils/parser.ts +++ b/packages/api/src/utils/parser.ts @@ -452,14 +452,11 @@ export const isProbablyNewsletter = async (html: string): Promise => { } // Check if this is a convertkit.com newsletter - if (dom.querySelectorAll('img[src*="convertkit-mail.com"]').length > 0) { - const convertkitUrl = convertkitNewsletterHref(dom) - if (convertkitUrl) { - return true - } - } - - return false + return ( + dom.querySelectorAll( + 'img[src*="convertkit.com"], img[src*="convertkit-mail.com"]' + ).length > 0 + ) } const beehiivNewsletterHref = (dom: Document): string | undefined => { From 65f28fe708ea646a9d211c21b14207f02c2cb0de Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Mon, 18 Jul 2022 10:44:39 +0800 Subject: [PATCH 2/2] add revue.email to the revue newsletter attribute selectors --- packages/api/src/utils/parser.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/api/src/utils/parser.ts b/packages/api/src/utils/parser.ts index f8716978e..7489b7373 100644 --- a/packages/api/src/utils/parser.ts +++ b/packages/api/src/utils/parser.ts @@ -444,7 +444,10 @@ export const isProbablyNewsletter = async (html: string): Promise => { } // Check if this is a newsletter from revue - if (dom.querySelectorAll('img[src*="getrevue.co"]').length > 0) { + if ( + dom.querySelectorAll('img[src*="getrevue.co"], img[src*="revue.email"]') + .length > 0 + ) { const getrevueUrl = revueNewsletterHref(dom) if (getrevueUrl) { return true