Last active
November 29, 2017 08:23
-
-
Save fktan5/9783035 to your computer and use it in GitHub Desktop.
認めるわけにはいかないわね
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
member* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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