Skip to content

Instantly share code, notes, and snippets.

@fktan5
Last active November 29, 2017 08:23
Embed
What would you like to do?
認めるわけにはいかないわね
require 'open-uri'
def get_filename(n,m,group)
if group.nil?
group = "otonokizaka"
end
return "http://lovelive-anime.jp/#{group}/img/member/member0#{n.to_s}_0#{m.to_s}.png"
end
def save_file(url)
filename = File.basename(url)
puts "download url : "+ url
open(filename, 'wb') do |file|
begin
open(url) do |data|
file.write(data.read)
end
rescue OpenURI::HTTPError => error
puts "ブッブーですわ!"
return
end
end
end
for n in 1..9
for m in 1..6
save_file(get_filename(n,m,ARGV[0]))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment