Created
August 27, 2018 23:08
-
-
Save BrandonDusseau/69eeef155b2e5cd28831eede2da90c73 to your computer and use it in GitHub Desktop.
Scrapes Slack's custom emoji page to return a leaderboard of how many emojis each user has contributed
This file contains 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
// Run on https://[yourslack].slack.com/customize/emoji | |
var counts = {}; | |
$(".c-table_view_row_container").each(function () { | |
var name = $(this).find(".p-customize_emoji_list__author").text(); | |
if (!counts[name]) { | |
counts[name]=1; | |
} else { | |
counts[name]+=1 | |
} | |
}); | |
var count_arr = []; | |
for (var name in counts) { | |
count_arr.push([name,counts[name]]) | |
}; | |
count_arr.sort(function (a,b) { | |
return b[1] - a[1]; | |
}); | |
var text=""; | |
for (var index in count_arr) { | |
text += (count_arr[index][0] + ": " + count_arr[index][1] + "\n"); | |
} | |
console.log(text); |
This file contains 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
var counts={};$(".c-table_view_row_container").each(function(){var a=$(this).find(".p-customize_emoji_list__author").text();if(!counts[a]){counts[a]=1}else{counts[a]+=1}});var count_arr=[];for(var name in counts){count_arr.push([name,counts[name]])}count_arr.sort(function(d,c){return c[1]-d[1]});var text="";for(var index in count_arr){text+=(count_arr[index][0]+": "+count_arr[index][1]+"\n")}console.log(text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment