Skip to content

Instantly share code, notes, and snippets.

@ikbear
Created March 6, 2012 13:37
Show Gist options
  • Save ikbear/1986315 to your computer and use it in GitHub Desktop.
Save ikbear/1986315 to your computer and use it in GitHub Desktop.
Download pictures from Vladimir Zotov's gallery
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