Created
May 30, 2022 11:06
-
-
Save Viiprogrammer/e04443e959225a5a0fa191e3c7423ac9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var types = { | |
'339966': 'voicer', | |
'00a650': 'voicer', | |
'800000': 'techie', | |
'ebd800': 'translator', | |
'f7941d': 'decorator', | |
'000080': 'seeder', | |
'b523c5': 'releaser', | |
'33cccc': 'designer' | |
} | |
const result = [] | |
for (const v of Object.values(document.querySelectorAll('.day'))) { | |
const membersEls = Object.values(v.nextSibling.nextSibling.querySelectorAll('ul > li')) | |
result.push({ | |
title: v.children[0].innerText, | |
subTitle: v.children?.[1]?.innerText ?? '', | |
members: getMembers(membersEls) | |
}) | |
} | |
document.write(JSON.stringify(result)) | |
function getMembers(membersEls) { | |
return membersEls.map(x => { | |
return { | |
name: x.innerText.split(' - ')[0], | |
description: x.innerText.split(' - ')[1], | |
type: x.children.length ? types[x.children[0].getAttribute('style').slice(8, -1)] : 'none' | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment