feat(aklive2d): updated the struct of offical_update.json

This commit is contained in:
Haoyu Xu
2023-10-08 01:33:49 -04:00
parent cd56225eaf
commit c5a301ecc7
2 changed files with 10 additions and 1 deletions

View File

@@ -10,7 +10,9 @@ export default async function () {
const dom = new jsdom.JSDOM(html_text); const dom = new jsdom.JSDOM(html_text);
const rows = dom.window.document.body.querySelector(".dynList").querySelectorAll(".row") const rows = dom.window.document.body.querySelector(".dynList").querySelectorAll(".row")
const dict = {} const dict = {
length: 0
}
for (const row of rows) { for (const row of rows) {
const date = row.querySelector(".date").textContent.trim() const date = row.querySelector(".date").textContent.trim()
@@ -18,6 +20,10 @@ export default async function () {
const charCards = row.querySelectorAll(".charCard") const charCards = row.querySelectorAll(".charCard")
if (dict.length === 0) {
dict.latest = date
}
for (const charCard of charCards) { for (const charCard of charCards) {
const color = charCard.style.color const color = charCard.style.color
const codename = { const codename = {
@@ -40,6 +46,7 @@ export default async function () {
codename, codename,
type type
}) })
dict.length++
} }
dict[date] = operators dict[date] = operators
} }

View File

@@ -1,4 +1,6 @@
{ {
"length": 33,
"latest": "2023/08",
"2023/08": [ "2023/08": [
{ {
"color": "rgb(183, 227, 243)", "color": "rgb(183, 227, 243)",