Skip to content

Instantly share code, notes, and snippets.

@fktan5
Last active November 29, 2017 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fktan5/9783035 to your computer and use it in GitHub Desktop.
Save fktan5/9783035 to your computer and use it in GitHub Desktop.
認めるわけにはいかないわね
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