Created
January 24, 2014 11:35
-
-
Save andyjeffries/8595802 to your computer and use it in GitHub Desktop.
Full HTML page (with asset) hashing
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
#!/usr/bin/env ruby | |
require 'tmpdir' | |
require 'digest/sha1' | |
hash = "" | |
Dir.mktmpdir do |dir| | |
`cd #{dir} && wget -E -H -k -K -q -p #{ARGV[0]}` | |
Dir["#{dir}/**/*"].each do |filename| | |
unless File.directory?(filename) | |
# puts filename | |
hash = Digest::SHA1.hexdigest(hash + File.read(filename)) | |
end | |
end | |
end | |
puts hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment