Created
March 6, 2012 13:37
-
-
Save ikbear/1986315 to your computer and use it in GitHub Desktop.
Download pictures from Vladimir Zotov's gallery
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
require "nokogiri" | |
require "open-uri" | |
doc = Nokogiri::HTML(open("http://vladimirzotov.500px.com/").read) | |
imgs = doc.css('img').map { |i| i['src'] } | |
i = 0 | |
for img in imgs | |
data = open(img) { |f| f.read } | |
open(i.to_s + ".jpg", "wb") { |f| f.write(data) } | |
i += 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment