Last active
May 14, 2018 15:23
-
-
Save Christian-G/ccad3257e68c4b31d790c4ed66a51761 to your computer and use it in GitHub Desktop.
Scrape thumbnails from 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
// 1. Visit https://geant.slack.com/team | |
// 2. Paste this code in your console | |
// 3. In console: copy(data) | |
var store = {} | |
$('div.member_item').each(function(i, e) { | |
var el = $(this); | |
var userimage = el.find('a.member_image').data('original'); | |
var email = el.find('div.expanded_member_details a[title~="Email"]')[0]; | |
if (email !== undefined && userimage.indexOf("?") === -1) { | |
store[email.innerHTML] = userimage.replace("72.jpg", "512.jpg").replace("72.png", "512.png").slice(5, -2); | |
} | |
}); | |
var data = $.each(store, function(k, value) { if (value) { console.log(k + " =>", value); } } ); |
My guess is you run this from the /admin slack page which you can go to by clicking on manage team members
, in other words the place where you can get the full member list of your slack community. I haven't figured out how to do the last part he mentions (e.g. copy(data)
).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any more info about how to use this?