Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Poll: Where do you live?. Parent comment
console.table(Object.entries([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).reduce((rv, [a,b]) => {var key = a.split(": ")[0]; rv[key] = rv[key] || 0; rv[key] += parseInt(b); return rv;}, {})).sort(([,a], [,b]) => parseInt(b) - parseInt(a)))
'US' 959 'Canada' 114 'United Kingdom' 96 'Germany' 96 'France' 35 'Netherlands' 30 'Sweden' 30 'Poland' 24 'Brazil' 24 'Denmark' 19 'Switzerland' 18
There are no comments on this comment yet.
console.table(Object.entries([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).reduce((rv, [a,b]) => {var key = a.split(": ")[0]; rv[key] = rv[key] || 0; rv[key] += parseInt(b); return rv;}, {})).sort(([,a], [,b]) => parseInt(b) - parseInt(a)))