chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2024-10-19 14:44:55 +02:00
parent c9ce29f206
commit 40e894df8b
294 changed files with 14209 additions and 4192 deletions

View file

@ -46,7 +46,9 @@ async function fetchRegularLanguages() {
const url = Wikidata.wds.sparqlQuery(sparql)
// request the generated URL with your favorite HTTP request library
const result = await Utils.downloadJson<{results: {bindings: any[]}}>(url, { "User-Agent": "MapComplete script" })
const result = await Utils.downloadJson<{ results: { bindings: any[] } }>(url, {
"User-Agent": "MapComplete script",
})
const bindings = <LanguageSpecResult[]>result.results.bindings
// Traditional chinese = 繁體中文 or 正體中文
@ -98,7 +100,9 @@ async function fetchSpecial(id: number, code: string): Promise<LanguageSpecResul
console.log("Special sparql:", sparql)
const url = Wikidata.wds.sparqlQuery(sparql)
const result = await Utils.downloadJson<{results: {bindings: any[]}}>(url, { "User-Agent": "MapComplete script" })
const result = await Utils.downloadJson<{ results: { bindings: any[] } }>(url, {
"User-Agent": "MapComplete script",
})
const bindings = result.results.bindings
bindings.forEach((binding) => (binding["code"] = { value: code }))
return bindings
@ -134,7 +138,9 @@ async function getOfficialLanguagesPerCountry(): Promise<Map<string, string[]>>
}`
const url = Wikidata.wds.sparqlQuery(sparql)
const result = await Utils.downloadJson<{results: {bindings: any[]}}>(url, { "User-Agent": "MapComplete script" })
const result = await Utils.downloadJson<{ results: { bindings: any[] } }>(url, {
"User-Agent": "MapComplete script",
})
const bindings: { countryCode: { value: string }; languageCode: { value: string } }[] =
result.results.bindings
for (const binding of bindings) {