forked from saurabh/orbit4-5
12 lines
315 B
Ruby
12 lines
315 B
Ruby
|
require "net/http"
|
||
|
require "uri"
|
||
|
require 'json'
|
||
|
namespace :nccu_calendar do
|
||
|
desc "Rake to download calendar"
|
||
|
task :download => :environment do
|
||
|
xmlfile = File.join(Rails.root, "public" , "nccu_calendar.xml")
|
||
|
open(xmlfile, 'wb') do |fo|
|
||
|
fo.print open('http://events.nccu.edu.tw/Month').read
|
||
|
end
|
||
|
end
|
||
|
end
|