orbit-basic/app/jobs/nccu_calendar.rb

13 lines
326 B
Ruby

class NccuCalendar
require 'open-uri'
@queue = :high
def self.perform()
File.open(File.join(Rails.root, 'public/static', 'nccu_calendar.rss'),'w') do |file|
file << open('http://events.nccu.edu.tw/Feed').read
CronMail.time_check("NCCU Calendar synced").deliver
end
puts "NccuCalendar Synced"
end
end