more stuff

This commit is contained in:
biglyderv 2025-02-02 21:59:07 -05:00
parent 5a2f0289bd
commit 0ae7c849b6

14
site.js
View file

@ -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)`);