Skip to content

Instantly share code, notes, and snippets.

@Christian-G
Last active May 14, 2018 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Christian-G/ccad3257e68c4b31d790c4ed66a51761 to your computer and use it in GitHub Desktop.
Save Christian-G/ccad3257e68c4b31d790c4ed66a51761 to your computer and use it in GitHub Desktop.
Scrape thumbnails from slack
// 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); } } );
@joshdance
Copy link

Any more info about how to use this?

@thanos-irodotou
Copy link

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