機能としては:
●60x24=1440枚を一気ダウンロード
といってもsleep1秒してるんで最速でも24分はかかりますが・・・
●時間を指定してダウンロード
よく掲示板で何時何分の子が可愛いとかよくあったので実装
以下ソース
*********************************************
require 'net/http'
def get_bijin(hour, minute)
begin
uri = "http://www.bijint.com/jp/img/clk/#{hour}#{minute}.jpg"
uri_path = uri.split(/bijint.com/).last
Net::HTTP.start("bijint.com", 80) do |http|
response = http.get(uri_path, "Referer" => "http://bijint.com/jp/")
save_file = File::basename(uri)
open(save_file, "wb") do |file|
file.puts response.body
puts "#{save_file} is download"
end
end
rescue =>ex
puts ex.message
end
end
if ARGV[0].nil? then
24.times do |hour|
60.times do |minute|
get_hour = sprintf("%02d",hour)
get_minute = sprintf("%02d", minute)
get_bijin(get_hour, get_minute)
sleep 1
end
end
else
*********************************************
今回文字ばっかで
全然女の子出てこねーじゃねーか!とお怒りを受けそうなので
最後に心ばかりの画像を・・・

満足頂けたでしょうか?
PR
Freepage List