fix ome funnies
This commit is contained in:
parent
2622c3bb06
commit
11681c8bd6
1 changed files with 6 additions and 7 deletions
11
site.js
11
site.js
|
@ -48,14 +48,15 @@ async function urlCollector(url, path, file, useLimit, data2) {
|
||||||
console.log(`User ${url} has ${urls.length} pages calculated`);
|
console.log(`User ${url} has ${urls.length} pages calculated`);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
let h3;
|
let h3;
|
||||||
try {
|
try {
|
||||||
h3 = new URL(new URL(url).origin);
|
h3 = new URL(new URL(url).origin);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return [...new Set(urls)];
|
|
||||||
}
|
}
|
||||||
urls.push(h3.toString())
|
urls.push(h3.toString())
|
||||||
|
if (!data2[url]) data2[url] = {following: [], followers: []};
|
||||||
|
data2[url][path] = urls;
|
||||||
|
|
||||||
return [...new Set(urls)];
|
return [...new Set(urls)];
|
||||||
}
|
}
|
||||||
|
@ -172,18 +173,16 @@ async function siteCollector(user, path, site, useLimit, dat) {
|
||||||
}
|
}
|
||||||
data[u] = { followers: [], following: [] };
|
data[u] = { followers: [], following: [] };
|
||||||
p.push(async function (k) {
|
p.push(async function (k) {
|
||||||
let j1 = await siteCollector(u, 'followers', site, true, data);
|
await siteCollector(u, 'followers', site, true, data);
|
||||||
|
|
||||||
data[u].followers = j1;
|
|
||||||
console.log(`User ${u} followers fully calculated`);
|
console.log(`User ${u} followers fully calculated`);
|
||||||
|
|
||||||
p[k] = 'hi';
|
p[k] = 'hi';
|
||||||
}(p.length));
|
}(p.length));
|
||||||
|
|
||||||
p.push(async function (k) {
|
p.push(async function (k) {
|
||||||
let j1 = await siteCollector(u, 'following', site,true, data);
|
await siteCollector(u, 'following', site,true, data);
|
||||||
|
|
||||||
data[u].following = j1;
|
|
||||||
console.log(`User ${u} following fully calculated`);
|
console.log(`User ${u} following fully calculated`);
|
||||||
|
|
||||||
p[k] = 'hi';
|
p[k] = 'hi';
|
||||||
|
|
Loading…
Reference in a new issue