Last active
May 27, 2019 02:23
-
-
Save Christian-G/ace18e68add60835ef342743161c9a58 to your computer and use it in GitHub Desktop.
Download profile pictures from Slack, use in combination with slack image scraper: https://gist.github.com/Christian-G/ccad3257e68c4b31d790c4ed66a51761
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
require 'open-uri' | |
require 'json' | |
class Profile | |
DATA = JSON.parse('<data object>') | |
end | |
Profile::DATA.each do |profile| | |
location = profile.last.sub('https', 'http') | |
name = profile.first | |
begin | |
open("#{name}.jpg", 'wb') do |file| | |
file << open(location).read | |
end | |
rescue | |
next | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment