prio interanl links

This commit is contained in:
biglyderv 2025-02-01 13:32:56 -05:00
parent 03b7527839
commit 8e822aba75

View file

@ -80,8 +80,6 @@ async function urlCollector(url, path, file, useLimit, data2) {
if (!data2[url]) data2[url] = { following: [], followers: [] };
data2[url][path] = [...new Set(urls)];
data2[url][path].sort((x, y) => ((new URL(x).host == new URL(url).host) ? 1 : 0) - ((new URL(y).host == new URL(url).host) ? 1 : 0))
return data2[url][path];
}
@ -260,10 +258,13 @@ async function siteCollector(user, path, site, useLimit, data2) {
for (let i = 0; i < d; i++) {
if (i != 0) {
let tempSet = dat.map(x => x[0]);
let oldLength = Object.keys(data).length;
let kk = Object.keys(data);
kk = kk.sort((x, y) => ((new URL(x).host == new URL(penv[0]).host) ? 0 : 1) - ((new URL(y).host == new URL(penv[0]).host) ? 0 : 1));
console.log(kk)
let oldLength = kk.length;
let theData = {};
for (let a = 0; a < oldLength * threshold && a < oldLength; a++) {
let key = Object.keys(data)[a];
let key = kk[a];
theData[key] = data[key];
}
users = tempSet.concat(await rounder(tempSet, theData, true));