Created
December 5, 2018 02:16
-
-
Save j4p3/6207788e572b90bef46db4c6a4ab8f6c to your computer and use it in GitHub Desktop.
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
def is_big(url) | |
puts "checking if #{url} is big" | |
conn = Faraday.new(url: url) | |
res = conn.get | |
Integer(res.headers["content-length"])/1024 > 5000 | |
end | |
Warehouse.all.map { |w| w.background_image_url }.compact.select { |u| is_big(u) }.size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment