require 'net/http'
list = %W[
rpg_actor_mv
rpg_actor_m
rpg_actor_f
rpg_actor_etc
rpg_icon
rpg_chadot4_10
rpg_chadot11_20
rpg_chadot21_30
rpg_chadot31_40
rpg_chadot41_50
rpg_chadot51_60
rpg_chadot61_70
rpg_chadot71_80
rpg_chadot81_90
rpg_chadot91_100
rpg_chadot101_110
rpg_chadot111_120
rpg_chadot121_130
rpg_chadot131_140
rpg_chadot141_150
rpg_chadot_etc
rpg_window
rpg_effect
rpg_map
]
list.each do |type|
Net::HTTP.get('usui.moo.jp', "/#{type}.html").scan(/<img src=\"(.+?.png)\"/) do |(addr)|
if addr.start_with? '.'
addr = addr[1..-1]
elsif !addr.start_with? '/'
addr.prepend '/'
end
data = Net::HTTP.get('usui.moo.jp', addr)
Dir.mkdir type unless Dir.exist? type
File.open("#{type}/#{File.basename addr}", 'wb') { |f| f.write data }
end
end
require 'net/http'
list = %W[
rpg_actor_mv
rpg_actor_m
rpg_actor_f
rpg_actor_etc
rpg_icon
rpg_chadot4_10
rpg_chadot11_20
rpg_chadot21_30
rpg_chadot31_40
rpg_chadot41_50
rpg_chadot51_60
rpg_chadot61_70
rpg_chadot71_80
rpg_chadot81_90
rpg_chadot91_100
rpg_chadot101_110
rpg_chadot111_120
rpg_chadot121_130
rpg_chadot131_140
rpg_chadot141_150
rpg_chadot_etc
rpg_window
rpg_effect
rpg_map
]
list.each do |type|
Net::HTTP.get('usui.moo.jp', "/#{type}.html").scan(/<img src=\"(.+?.png)\"/) do |(addr)|
if addr.start_with? '.'
addr = addr[1..-1]
elsif !addr.start_with? '/'
addr.prepend '/'
end
data = Net::HTTP.get('usui.moo.jp', addr)
Dir.mkdir type unless Dir.exist? type
File.open("#{type}/#{File.basename addr}", 'wb') { |f| f.write data }
end
end