Skip to content

Commit

Permalink
Update helper.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NotII committed Jul 13, 2021
1 parent 9643da0 commit 19a75c8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function getPostCount(account) {
const t = data(".active").text();
newData = t.match(/\d+/g);
if (newData[1]) {
scrapePosts(account, Math.round(((parseInt(newData[0]) + parseInt(newData[1]) - 32) / 20) + 2));
scrapePosts(account, Math.round(((newData[0] + newData[1] - 32) / 20) + 2));
} else {
const calc = Math.round((parseInt(newData[0]) - 32) / 20) + 2
if (calc < 1) {
Expand All @@ -43,7 +43,7 @@ function scrapePosts(result, maxPage) {
checkPost(d(value).attr("href"), result, resp.config.url);
});
})
.catch(() => {});
.catch((e) => {console.log(e.resp.config)});
}

function checkPost(url) {
Expand Down Expand Up @@ -83,6 +83,16 @@ function send(url) {
});
}

process.on("uncaughtException", (err) => {
console.error(err)
});
process.on("uncaughtExceptionMonitor", (err) => {
console.error(err)
});
process.on("unhandledRejection", (err) => {
console.error(err)
});

module.exports = {
getPostCount,
};

0 comments on commit 19a75c8

Please sign in to comment.