This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/jobs/nccu_calendar.rb

16 lines
335 B
Ruby
Raw Normal View History

class NccuCalendar
require 'open-uri'
2012-05-15 06:03:54 +00:00
require 'tempfile'
@queue = :high
def self.perform()
2012-05-15 06:03:54 +00:00
temp_file = Tempfile.new('new_cal')
temp_file << open('http://events.nccu.edu.tw/Month').read
FileUtils.mv(temp_file, File.join(Rails.root, 'public/static', 'nccu_calendar.xml'))
puts "NccuCalendar Synced"
end
end