Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

download all the images assets that used in css file

View fetch_css_images.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
require "fileutils"
require "net/http"
require "uri"
require "cgi"
def fetch(filename)
matched = open(filename) do |f|
content = f.read
content.scan(/url.*images\/(.*?)\'/i).flatten!
end
puts matched.inspect
matched.each do |m|
uri = URI.parse("http://ponjoh.s3.amazonaws.com/HTML%20Templates/Simpla%20Admin/resources/images/#{m}")
puts "fetch #{uri.path} ..."
response = Net::HTTP.get_response(uri)
dirs = m.split("/")
if dirs.size > 1
FileUtils.mkdir_p m.split("/")[0...-1].join("/")
end
File.open(m, "wb") { |f| f.write response.body}
end
puts "done"
end
 
fetch "style.css"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.