diff --git a/updateFeeds.js b/updateFeeds.js index 195e0de..c33737d 100644 --- a/updateFeeds.js +++ b/updateFeeds.js @@ -18,6 +18,7 @@ doFeed(); function doFeed() { let feed = feeds[count]; + console.log(count, feed.feed); if (feed === undefined) { return; } @@ -71,10 +72,12 @@ function doFeed() { // update the DB with new contents let content = JSON.stringify(feedData); db.prepare('insert or replace into feeds(feed, username, content) values(?, ?, ?)').run(feed.feed, acct, content); - doFeed(++count); + count = count + 1; + setTimeout(doFeed, 100); } else { - doFeed(++count); + count = count + 1; + setTimeout(doFeed, 100); } } }); @@ -125,12 +128,6 @@ function transformContent(item) { if($(el).html().replace(/\s| /g, '').length === 0) {$(el).remove();} }); - // convert li items to bullet points - $('li').each((i, el) => { - //console.log($(el).html()); - $(el).replaceWith(`- ${$(el).html()}
`); - }); - // couple of hacky regexes to make sure we clean up everything item.content = $('body').html().replace(/^(\n|\r)/,'').replace(/>\r+\r+