-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path_approvedUsersReduction.js
More file actions
39 lines (29 loc) · 945 Bytes
/
_approvedUsersReduction.js
File metadata and controls
39 lines (29 loc) · 945 Bytes
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
import snoowrap from "snoowrap"
import csv from "csvtojson"
import jsonexport from "jsonexport"
import fs from "fs"
import ipfsClient from "ipfs-http-client"
import fetch from "node-fetch"
import merklize from "./merklize.js"
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
main()
async function main(){
let counter = 0
let weight = 20000
let approvedUsers = []
const users = await fetch("https://ethtrader.github.io/donut.distribution/users.json").then(res=>res.json())
users.forEach(c=>{
// console.log(c)
if(c.weight >= weight) {
// counter++
approvedUsers.push(c)
}
}
)
console.log("total approved users: " + approvedUsers.length)
const newFileNameBase = `${__dirname}/docs/approvedUsers`
fs.writeFileSync(`${newFileNameBase}.json`, JSON.stringify(approvedUsers, null, 2))
}