-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandleInfo.js
53 lines (34 loc) · 1018 Bytes
/
handleInfo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
let followers = [];
let followings = [];
async function getFollowers(){
const url = `followers.csv`;
const response = await fetch(url);
const data = await response.text();
const rows = data.split('\n');
rows.forEach(row => {
let newRow = row.replace("\r","");
followers.push( newRow );
});
}
async function getFollowings(){
const url = `followings.csv`;
const response = await fetch(url);
const data = await response.text();
const rows = data.split('\n');
rows.forEach(row => {
let newRow = row.replace("\r","");
followings.push( newRow );
});
}
let toUnfollow = [];
async function fillToUnfollowList(){
await getFollowers();
await getFollowings();
followings.forEach(username => {
if( !followers.includes(username) ) {
toUnfollow.push( username );
console.log(username);
}
});
}
fillToUnfollowList();