diff --git a/index.js b/index.js index db9fc99..7856819 100644 --- a/index.js +++ b/index.js @@ -32,13 +32,15 @@ if (mode == 'cli') { let json = await fetch("https://nbg.dervland.net/api/followjson.php"); json = await json.json(); + let { ref } = req.query; + let data = {}; for (let entryI in json) { let entry = json[entryI]; let user = data[entry.username] || {}; let target = data[entry.target] || {}; - + let f1 = user.following = user.following || []; let f2 = user.followers = user.followers || []; let f3 = target.following = target.following || []; @@ -50,10 +52,7 @@ if (mode == 'cli') { data[entry.username] = user; data[entry.target] = target; } - - console.log(data) - - let calcedRank = rankCalc(data, matrixIterations, [], false, settings.isGpu); + let calcedRank = rankCalc(data, matrixIterations, ref ? [ref] : [], false, settings.isGpu); let dat = Object.entries(calcedRank); dat = dat.sort((a, b) => b[1] - a[1]); console.log(`Graph is calculated with ${dat.length} entries`);