mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-23 00:27:30 +00:00
Add RSS and Cloudflare to /api/instances
This commit is contained in:
parent
12798c23aa
commit
b9c4a9a090
@ -27,13 +27,15 @@ module.exports = [
|
|||||||
while (inTable && parser.hasRemaining()) {
|
while (inTable && parser.hasRemaining()) {
|
||||||
const line = parser.get({split: "\n"})
|
const line = parser.get({split: "\n"})
|
||||||
if (line.startsWith("|")) {
|
if (line.startsWith("|")) {
|
||||||
/** [empty, official, address, country] */
|
/** [empty, official, address, country, rss, cloudflare] */
|
||||||
const parts = line.split("|")
|
const parts = line.split("|")
|
||||||
if (parts.length >= 4 && parts[2].includes("://")) {
|
if (parts.length >= 4 && parts[2].includes("://")) {
|
||||||
instances.push({
|
instances.push({
|
||||||
address: parts[2].trim(),
|
address: parts[2].trim(),
|
||||||
country: parts[3].match(/[A-Z]{2,}|$/)[0] || null,
|
country: parts[3].match(/[A-Z]{2,}|$/)[0] || null,
|
||||||
official: parts[1].trim() === ":white_check_mark:"
|
official: parts[1].trim() === ":white_check_mark:",
|
||||||
|
rss: parts[4].trim() === ":white_check_mark:",
|
||||||
|
cloudflare: parts[5].trim() === ":crying_cat_face:"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user