Last active
January 30, 2017 04:01
-
-
Save sethkrasnianski/4d4b0feee8af556a74d8eda7521f5343 to your computer and use it in GitHub Desktop.
User emoji contribution on Slack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userCount = Array | |
.from(document.querySelectorAll('.author_cell a')) | |
.map((node) => node.innerText) | |
.sort() | |
.reduce((prev, curr) => (prev[curr] = ++prev[curr] || 1, prev), {}); | |
const sortedCount = Object | |
.keys(userCount) | |
.sort((a,b) => userCount[b] - userCount[a]) | |
.map(u => [u, userCount[u]]) | |
sortedCount.forEach(([u, c]) => console.log(u, c)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment