more stuff
This commit is contained in:
parent
5a2f0289bd
commit
0ae7c849b6
1 changed files with 8 additions and 6 deletions
14
site.js
14
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)`);
|
||||
|
|
Loading…
Reference in a new issue