-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (39 loc) · 1.15 KB
/
index.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
const fs = require("fs");
const instances = JSON.parse(fs.readFileSync("instances.json", "utf8"));
function badge(url, label, path) {
return `}&query=${encodeURIComponent(path)}&label=${encodeURIComponent(label)})`;
}
async function run() {
fs.writeFileSync(
"README.md",
`# Instances of TXTDot proxies\n\n|link|tags|\n|-|-|\n${(
instances.map((instance) => {
if (typeof instance === "string") {
const config_url = instance + "/configuration/json";
return `|<${instance}>|${badge(
config_url,
"version",
"version"
)} ${badge(config_url, "protocol", "protocol")} ${badge(
config_url,
"searx",
"third_party.searx_url"
)} ${badge(
config_url,
"webder",
"third_party.webder_url"
)} ${badge(
config_url,
"image compression",
"proxy.img_compress"
)}|`;
}
})
)
.join("\n")}
`
);
}
run();