-
-
Notifications
You must be signed in to change notification settings - Fork 528
/
Copy pathupdate-contributors.js
104 lines (98 loc) · 2.39 KB
/
update-contributors.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import fs from "node:fs";
import { URL } from "node:url";
const AVATAR_RE = /property="og:image" content="([^"]+)/;
async function fetchAvatar(username) {
const res = await fetch(`https://github.com/${username}`);
if (!res.ok) throw new Error(`${res.url} responded with ${res.status}`);
const body = await res.text();
const match = body.match(AVATAR_RE);
if (!match) throw new Error(`Could not find avatar for ${username}`);
return match[1];
}
const OPENAPI_TS_CONTRIBUTORS = [
...new Set([
"drwpow",
"psmyrdek",
"enmand",
"atlefren",
"tpdewolf",
"tombarton",
"svnv",
"sorin-davidoi",
"scvnathan",
"lbenie",
"bokub",
"antonk52",
"tshelburne",
"mmiszy",
"skh-",
"BlooJeans",
"selbekk",
"Mause",
"henhal",
"gr2m",
"samdbmg",
"rendall",
"robertmassaioli",
"jankuca",
"th-m",
"asithade",
"MikeYermolayev",
"radist2s",
"FedeBev",
"yamacent",
"dnalborczyk",
"FabioWanner",
"ashsmith",
"mehalter",
"Chrg1001",
"sharmarajdaksh",
"shuluster",
"FDiskas",
"ericzorn93",
"mbelsky",
"Peteck",
"rustyconover",
"bunkscene",
"ottomated",
"sadfsdfdsa",
"ajaishankar",
"dominikdosoudil",
"kgtkr",
"berzi",
"PhilipTrauner",
"Powell-v2",
"duncanbeevers",
"tkukushkin",
"Semigradsky",
"MrLeebo",
"axelhzf",
"imagoiq",
"BTMPL",
"HiiiiD",
"yacinehmito",
"sajadtorkamani",
"mvdbeek",
"sgrimm",
"Swiftwork",
"mtth",
"mitchell-merry",
"qnp",
"shoffmeister",
"liangskyli",
"happycollision",
"barakalon",
"pvanagtmaal",
]),
];
export const OPENAPI_FETCH_CONTRIBUTORS = [...new Set(["drwpow", "fergusean", "shinzui", "ezpuzz", "KotoriK", "fletchertyler914", "nholik", "roj1512", "nickcaballero", "hd-o", "kecrily", "psychedelicious"])];
async function main() {
const openapiTS = Promise.all(OPENAPI_TS_CONTRIBUTORS.map(async (username) => ({ username, avatar: await fetchAvatar(username) })));
const openapiFetch = Promise.all(OPENAPI_FETCH_CONTRIBUTORS.map(async (username) => ({ username, avatar: await fetchAvatar(username) })));
const contributors = {
"openapi-typescript": await openapiTS,
"openapi-fetch": await openapiFetch,
};
fs.writeFileSync(new URL("../src/data/contributors.json", import.meta.url), JSON.stringify(contributors));
}
main();