This commit is contained in:
Artemy 2024-05-22 17:44:40 +03:00
parent 22255d4424
commit 15494eddbd
2 changed files with 54 additions and 25 deletions

View file

@ -1,10 +1,6 @@
# instances # Instances of TXTDot proxies
Instances of TXTDot proxies - <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)
| Name | Base URL | Search | Connection | - <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)
| 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 |

View file

@ -2,21 +2,54 @@ const fs = require("fs");
const instances = JSON.parse(fs.readFileSync("instances.json", "utf8")); 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( fs.writeFileSync(
"README.md", "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 return `- <${instance}> ${badge(
config_url,
| Name | Base URL | Search | Connection | "version",
| ---- | -------- | ------ | ---------- | "version"
${instances )} ${badge(config_url, "protocol", "protocol")} ${badge(
.map( config_url,
(instance) => "searx",
`| ${instance.name} | <${instance.baseUrl}> | ${ "third_party.searx_url"
instance.search ? "enabled" : "" )} ${badge(config_url, "webder", "third_party.webder_url")} ${badge(
} | ${instance.HTTPS ? "https" : "http"} |` 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();