numCases = {
const parser = new DOMParser();
const el = parser.parseFromString(
await fetch(
'https://j-f1-cors-proxy.glitch.me/https://coronavirus.health.ny.gov/county-county-breakdown-positive-cases'
).then(res => res.text()),
'text/html'
);
const updated = d3.timeParse("Last Update: %B %-d, %Y | %-I:%M%p")(
el.querySelector('main .paragraph [class$=title]').textContent
);
const rows = [...el.querySelector('main table tbody').children].slice(1, -1);
return Object.assign(
new Map(
rows.map(row => [
row.children[0].textContent.trim(),
parseInt(row.children[1].textContent.replace(/[^\d]/g, ''))
])
),
{ updated }
);
}