From 0ae7c849b64f7f1ed72f92a9a40f4dd7119ffbc2 Mon Sep 17 00:00:00 2001 From: biglyderv Date: Sun, 2 Feb 2025 21:59:07 -0500 Subject: [PATCH] more stuff --- site.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/site.js b/site.js index 84d14c7..36d5df6 100644 --- a/site.js +++ b/site.js @@ -14,12 +14,13 @@ let rel = (process.env.rel == 'relative'); let hh; let percent = 0; let d = process.env.depth || 1; -let noWorry = []; +let noWorry = {}; async function urlCollector(url, path, file, useLimit, data2) { let urls = data2[url] ? (data2[url][path] || []) : []; urls = [...urls]; - if (path != 'following' || noWorry.indexOf(url) != -1) return urls; + if (path != 'following') return urls; + if (noWorry[url]) return [...noWorry[url]] let data; try { @@ -76,9 +77,6 @@ async function urlCollector(url, path, file, useLimit, data2) { return true; }) - if (!returnedFalse) { - noWorry.push(url); - } let h3; try { @@ -91,6 +89,10 @@ async function urlCollector(url, path, file, useLimit, data2) { if (!data2[url]) data2[url] = { following: [], followers: [] }; data2[url][path] = [...new Set(urls)]; + if (!returnedFalse) { + noWorry[url] = [...data2[url][path]]; + } + return data2[url][path]; } @@ -126,7 +128,7 @@ async function rounder(users, data, mode) { } if (timeout) break; if (!data[u]) data[u] = { followers: [], following: [] }; - if (noWorry.indexOf(u) != -1) { + if (noWorry[u]) { percent += 50 / d / users.length; console.log(`User ${u} followers was already fully calculated (${percent}% total)`);