by newaccount74 · 4y ago · 0 comments
console.table([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.replace(/:.*/,'').trim(), parseInt(el.nextSibling.textContent.trim())]).reduce((d, [k,v]) => {d[k]=v + (d[k] || 0); return d}, {}))
I can't figure out how to sort that, though...Are you accepting PRs? If so, align=right. Thanks!
To see the sorted results: https://gabrielsroka.github.io/hnpoll.html?id=30210378
Source: https://github.com/gabrielsroka/gabrielsroka.github.io/blob/...
Makes sense, otherwise entries would contain itself.
Thank you!