require 'net/http'
list = %W[
rpg_actor_mv_m
rpg_actor_mv_f
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
rpg_kinotake_sozai
]
def usui_scan_dl html, type, re
html.scan re do |(addr)|
addr.sub!(/\A(http:\/\/usui.moo.jp|\.)/, '')
addr.prepend '/' unless addr.start_with? '/'
data = Net::HTTP.get 'usui.moo.jp', addr
File.open("#{type}/#{File.basename addr}", 'wb') { |f| f.write data }
puts "Downloaded: #{addr}"
end
end
list.each do |type|
Dir.mkdir type unless Dir.exist? type
html = Net::HTTP.get('usui.moo.jp', "/#{type}.html")
usui_scan_dl(html, type, /<img src=\"(.+?.png)\"/)
usui_scan_dl(html, type, /<a href=\"(.+?.zip)\"/)
end
require 'net/http'
list = %W[
rpg_actor_mv_m
rpg_actor_mv_f
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
rpg_kinotake_sozai
]
def usui_scan_dl html, type, re
html.scan re do |(addr)|
addr.sub!(/\A(http:\/\/usui.moo.jp|\.)/, '')
addr.prepend '/' unless addr.start_with? '/'
data = Net::HTTP.get 'usui.moo.jp', addr
File.open("#{type}/#{File.basename addr}", 'wb') { |f| f.write data }
puts "Downloaded: #{addr}"
end
end
list.each do |type|
Dir.mkdir type unless Dir.exist? type
html = Net::HTTP.get('usui.moo.jp', "/#{type}.html")
usui_scan_dl(html, type, /<img src=\"(.+?.png)\"/)
usui_scan_dl(html, type, /<a href=\"(.+?.zip)\"/)
end