From 8e822aba754545adc03fadb9ed575967ddd20e0c Mon Sep 17 00:00:00 2001 From: biglyderv Date: Sat, 1 Feb 2025 13:32:56 -0500 Subject: [PATCH] prio interanl links --- site.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/site.js b/site.js index a7623d6..ab3617e 100644 --- a/site.js +++ b/site.js @@ -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));