From 737c418ed7257abe1f1af835c085ecdec193a550 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Tue, 7 May 2019 10:20:21 -0700 Subject: [PATCH] Fixes to formatting and payload processing order --- updateFeeds.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/updateFeeds.js b/updateFeeds.js index 9ffceaf..bcdbc65 100644 --- a/updateFeeds.js +++ b/updateFeeds.js @@ -18,8 +18,8 @@ async function foo() { const { id, payload } = await beanstalkd.reserve() console.log(payload) /* ... process job here ... */ - await doFeed(payload) await beanstalkd.delete(id) + await doFeed(payload) } catch (err) { // Log error somehow console.error(err) @@ -136,8 +136,8 @@ function transformContent(item) { }); // couple of hacky regexes to make sure we clean up everything - item.content = $('body').html().replace(/^(\n|\r)/,'').replace(/>\r+\r+\r+<').replace(/ +/g, ''); + item.content = item.content.replace(/^(\n|\r)/,'').replace(/>\r+<').replace(/>\s*<').replace(/>\u200B+<').replace(/ +/g, '').replace(/

<\/p>/g,''); return item; }