fail
This commit is contained in:
parent
a92a619684
commit
6cd3593483
1 changed files with 11 additions and 5 deletions
12
site.js
12
site.js
|
@ -75,20 +75,23 @@ async function textCollector(word, path, file) {
|
||||||
let words = hh.split(/[\n.]+/g).filter(x => word.length == 0 || ` ${x} `.includes(` ${word} `));
|
let words = hh.split(/[\n.]+/g).filter(x => word.length == 0 || ` ${x} `.includes(` ${word} `));
|
||||||
words = words.join(' ').split(/[^a-zA-Z0-9']+/g);
|
words = words.join(' ').split(/[^a-zA-Z0-9']+/g);
|
||||||
words = [...new Set(words)];
|
words = [...new Set(words)];
|
||||||
|
|
||||||
|
if (!data2[word]) data2[word] = { following: [], followers: [] };
|
||||||
|
data2[word][path] = words;
|
||||||
return words;
|
return words;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function siteCollector(user, path, site, useLimit, dat) {
|
async function siteCollector(user, path, site, useLimit, data2) {
|
||||||
let users = [];
|
let users = [];
|
||||||
let i = 1;
|
let i = 1;
|
||||||
let out = [];
|
let out = [];
|
||||||
|
|
||||||
if (site == 'file') {
|
if (site == 'file') {
|
||||||
return await textCollector(user, path, route);
|
return await textCollector(user, path, route, data2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (site == 'url') {
|
if (site == 'url') {
|
||||||
return await urlCollector(user, path, route, useLimit, dat);
|
return await urlCollector(user, path, route, useLimit, data2);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -131,6 +134,9 @@ async function siteCollector(user, path, site, useLimit, dat) {
|
||||||
console.log(`User ${user} has ${i} pages calculated`);
|
console.log(`User ${user} has ${i} pages calculated`);
|
||||||
}
|
}
|
||||||
out = out.concat(...users);
|
out = out.concat(...users);
|
||||||
|
|
||||||
|
if (!data2[user]) data2[user] = { following: [], followers: [] };
|
||||||
|
data2[user][path] = out;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue