Move ingestion scripts to ingest
This commit is contained in:
1
ingest/data.json
Normal file
1
ingest/data.json
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
|
|||||||
const data = require("./data.json")
|
import fs from "fs"
|
||||||
const fs = require("fs")
|
|
||||||
|
const data = JSON.parse(fs.readFileSync("data.json", "utf8"))
|
||||||
|
|
||||||
const dataPerRegion = {}
|
const dataPerRegion = {}
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ for (const item of data) {
|
|||||||
|
|
||||||
for (const region in dataPerRegion) {
|
for (const region in dataPerRegion) {
|
||||||
const sanitizedRegion = region.replaceAll(" ", "_").replaceAll("-", "_")
|
const sanitizedRegion = region.replaceAll(" ", "_").replaceAll("-", "_")
|
||||||
const regionFile = `public/${sanitizedRegion}.json`
|
const regionFile = `../public/${sanitizedRegion}.json`
|
||||||
console.log("Writing to", regionFile)
|
console.log("Writing to", regionFile)
|
||||||
fs.writeFileSync(regionFile, JSON.stringify(dataPerRegion[region], null, 2))
|
fs.writeFileSync(regionFile, JSON.stringify(dataPerRegion[region], null, 2))
|
||||||
}
|
}
|
||||||
BIN
ingest/static.db
Normal file
BIN
ingest/static.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user