mirror of
https://github.com/TxtDot/instances.git
synced 2024-11-21 12:26:22 +03:00
new look
This commit is contained in:
parent
22255d4424
commit
15494eddbd
2 changed files with 54 additions and 25 deletions
14
README.md
14
README.md
|
@ -1,10 +1,6 @@
|
|||
# instances
|
||||
# Instances of TXTDot proxies
|
||||
|
||||
Instances of TXTDot proxies
|
||||
|
||||
| Name | Base URL | Search | Connection |
|
||||
| ------------ | -------------------------- | ------- | ---------- |
|
||||
| Official 1 | <https://txt.dc09.ru> | enabled | https |
|
||||
| Official 2 | <https://txt.artegoser.ru> | enabled | https |
|
||||
| Bloatcat | <https://txt.bloat.cat> | enabled | https |
|
||||
| Clovius club | <https://txt.clovius.club> | enabled | https |
|
||||
- <https://txt.dc09.ru> ![search](https://img.shields.io/badge/search-enabled-blue) ![protocol](https://img.shields.io/badge/protocol-https-blue)
|
||||
- <https://txt.artegoser.ru> ![search](https://img.shields.io/badge/search-enabled-blue) ![protocol](https://img.shields.io/badge/protocol-https-blue)
|
||||
- <https://txt.bloat.cat> ![search](https://img.shields.io/badge/search-enabled-blue) ![protocol](https://img.shields.io/badge/protocol-https-blue)
|
||||
- <https://txt.clovius.club> ![search](https://img.shields.io/badge/search-enabled-blue) ![protocol](https://img.shields.io/badge/protocol-https-blue)
|
||||
|
|
57
index.js
57
index.js
|
@ -2,21 +2,54 @@ const fs = require("fs");
|
|||
|
||||
const instances = JSON.parse(fs.readFileSync("instances.json", "utf8"));
|
||||
|
||||
function badge(url, label, path) {
|
||||
return `![${label}](https://img.shields.io/badge/dynamic/json?url=${encodeURIComponent(
|
||||
url
|
||||
)}&query=${encodeURIComponent(path)}&label=${encodeURIComponent(label)})`;
|
||||
}
|
||||
|
||||
function static(label, text) {
|
||||
return `![${label}](https://img.shields.io/badge/${label}-${text}-blue)`;
|
||||
}
|
||||
|
||||
async function run() {
|
||||
fs.writeFileSync(
|
||||
"README.md",
|
||||
`# instances
|
||||
`# Instances of TXTDot proxies
|
||||
\r${(
|
||||
await Promise.all(
|
||||
instances.map(async (instance) => {
|
||||
if (typeof instance === "string") {
|
||||
const config_url = instance + "/configuration/json";
|
||||
let config = await fetch(config_url).then((res) => res.json());
|
||||
|
||||
Instances of TXTDot proxies
|
||||
|
||||
| Name | Base URL | Search | Connection |
|
||||
| ---- | -------- | ------ | ---------- |
|
||||
${instances
|
||||
.map(
|
||||
(instance) =>
|
||||
`| ${instance.name} | <${instance.baseUrl}> | ${
|
||||
instance.search ? "enabled" : ""
|
||||
} | ${instance.HTTPS ? "https" : "http"} |`
|
||||
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"
|
||||
)}`;
|
||||
} else {
|
||||
return `- <${instance.baseUrl}> ${
|
||||
instance.search ? static("search", "enabled") : ""
|
||||
} ${
|
||||
instance.HTTPS
|
||||
? static("protocol", "https")
|
||||
: static("protocol", "http")
|
||||
}`;
|
||||
}
|
||||
})
|
||||
)
|
||||
.join("\n")}
|
||||
).join("\n")}
|
||||
`
|
||||
);
|
||||
}
|
||||
|
||||
run();
|
||||
|
|
Loading…
Add table
Reference in a new issue