Skip to content

Instantly share code, notes, and snippets.

@usmonster
Created September 12, 2019 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usmonster/341841757d4b0952b6620278c368158a to your computer and use it in GitHub Desktop.
Save usmonster/341841757d4b0952b6620278c368158a to your computer and use it in GitHub Desktop.
A little JS snippet you can run from the browser console of the Slack stats page to see the "true ranking" of top message senders
// 1. go to https://{YOUR_SLACK_DOMAIN}.slack.com/stats#members
// 2. open the browser console
// 3. enter this (note: it might warn you that pasting code is bad):
$.post(`/api/team.stats.listUsers?_x_id=${boot_data.version_uid.slice(0,8)}-${Math.round(performance.now()*100)/100}`, {
count: 50,
sort_prefix: 'chats_sent',
sort_dir: 'desc',
date_range: '30d',
set_active: true,
token: boot_data.api_token,
_x_mode: 'online'
}).done(({stats}) => console.table(
stats.map(({
first_name,
last_name,
username,
messages_sent,
chats_sent,
days_active
}) => ({
name: `${first_name ? `${first_name} ${last_name}`.trim() : username}`,
/*messages_sent,*/
chats_sent,
days_active,
da_chat_rate: Math.round(chats_sent * 10 / days_active) / 10
})).sort((a, b) => b.da_chat_rate - a.da_chat_rate)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment