Skip to content

Instantly share code, notes, and snippets.

@biwakonbu
Created January 21, 2013 00:37
Show Gist options
  • Save biwakonbu/4582820 to your computer and use it in GitHub Desktop.
Save biwakonbu/4582820 to your computer and use it in GitHub Desktop.
某女性時計の画像ダウンロードスクリプト ref: http://qiita.com/items/6940fa137d261aa1be7c
require 'open-uri'
def to_date(date)
if date.to_s.length < 2
"0" + date.to_s
else
date.to_s
end
end
dirname = 'img/'
0.step 23, 1 do |hour|
0.step 59, 1 do |min|
hour = to_date(hour)
min = to_date(min)
open(dirname + hour + min + "jp.jpg", 'wb') do |output|
open("http://www.bijint.com/jp/tokei_images/#{hour + min}.jpg",
"Referer" => "http://www.bijint.com/jp/") do |img|
output.write(img.read)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment