Skip to content

Instantly share code, notes, and snippets.

@TimeBandit
Last active March 11, 2020 22:18
Show Gist options
  • Save TimeBandit/34a7d372269dad06938494eabb8ad373 to your computer and use it in GitHub Desktop.
Save TimeBandit/34a7d372269dad06938494eabb8ad373 to your computer and use it in GitHub Desktop.
get cv19 tabular data
infectionCount = [];
timeString = document.querySelector('.govspeak > p:nth-child(4)').innerText.split(' on ')[1].slice(0, -1).replace(/(\r\n|\n|\r)/gm,"");
isoTimeString = new Date(timeString).toISOString();
document.querySelectorAll('tbody > tr').forEach((row) => {
let [authority, numberOfCases] = row.cells;
infectionCount.push({
authority: authority.innerText,
numberOfCases: numberOfCases.innerText
})
})
const rows = infectionCount.map((row) => `${row.authority};${row.numberOfCases}`).join('\n')
console.log(`;${isoTimeString}\n${rows}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment