require 'net/http'
require 'uri'
url = URI.parse('http://www.infoq.com/')
(1..53).each do |i|
res = Net::HTTP.start(url.host, url.port) {|http|
http.get("/resource/presentations/zhaolu-jquery/zh/slides/zl-#{i}.swf")
}
File.new("#{i}.swf","w+") unless File.exist?("#{i}.swf")
f = File.open("#{i}.swf",'w+')
f.puts res.body
f.close
puts "完成#{format("%.2f",i*100/53).to_f}%"
end