Skip to content

Instantly share code, notes, and snippets.

@Viiprogrammer
Created May 30, 2022 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Viiprogrammer/e04443e959225a5a0fa191e3c7423ac9 to your computer and use it in GitHub Desktop.
Save Viiprogrammer/e04443e959225a5a0fa191e3c7423ac9 to your computer and use it in GitHub Desktop.
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