fixing counter

This commit is contained in:
Michael (GP) 2022-11-28 09:43:44 -05:00
parent 2fe026d4cc
commit 3d75882bc5

5
bot.js
View File

@ -31,12 +31,13 @@ async function postFeed() {
let count = 0; let count = 0;
feed.items.every(async (item) => { feed.items.every(async (item) => {
if (count > maxPostPerScan) return false;
let pubDate = new Date(item.pubDate); let pubDate = new Date(item.pubDate);
if (pubDate > postDate) { if (pubDate > postDate) {
count++; count++;
if (count > maxPostPerScan) return false;
await M.post("statuses", { await M.post("statuses", {
status: `${item.title}\n\n#NeoVibe #${process.env.POST_HASHTAG}\n\n${item.link}`, status: `${item.title}\n\n#NeoVibe #${process.env.POST_HASHTAG}\n\n${item.link}`,
}); });