Skip to content

Instantly share code, notes, and snippets.

@yswallow
Created March 14, 2013 13:57
Show Gist options
  • Save yswallow/5161521 to your computer and use it in GitHub Desktop.
Save yswallow/5161521 to your computer and use it in GitHub Desktop.
JR四国のサイトから予讃線・上りの時刻表の画像ファイルをダウンロードするスクリプト
require 'open-uri'
Dir.mkdir("yosan_up") unless FileTest.exist? "yosan_up"
("01".."18").each do |i|
url = "http://www.jr-eki.com/timetable/yosan_up-seto/img/#{i}.gif"
image = open(url).read
File.write("yosan_up/" + i + ".gif",image)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment