Skip to content

Instantly share code, notes, and snippets.

@umran
Created May 24, 2020 10:33
Show Gist options
  • Save umran/00342d1c75edde12d73e1dad6a371f6b to your computer and use it in GitHub Desktop.
Save umran/00342d1c75edde12d73e1dad6a371f6b to your computer and use it in GitHub Desktop.
compute confirmed daily case counts for a given date from https://covid19.health.gov.mv/dashboard
const confirmedDailyCaseCount = date => {
const data = document.getElementsByClassName("covid_table_row_item case_confirmed")
let count = 0
for (var i=0; i<data.length; i++) {
if (data.item(i).childNodes[0].nodeValue === date) {
count++
}
}
return count
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment