Calendar sync done,need Ray's JS change
This commit is contained in:
parent
b22a275360
commit
f827e8429e
|
@ -97,6 +97,7 @@ GEM
|
||||||
railties (~> 3.0)
|
railties (~> 3.0)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
json (1.6.5)
|
json (1.6.5)
|
||||||
|
libv8 (3.3.10.4)
|
||||||
linecache19 (0.5.12)
|
linecache19 (0.5.12)
|
||||||
ruby_core_source (>= 0.1.4)
|
ruby_core_source (>= 0.1.4)
|
||||||
mail (2.3.3)
|
mail (2.3.3)
|
||||||
|
@ -226,6 +227,8 @@ GEM
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
subexec (0.2.1)
|
subexec (0.2.1)
|
||||||
|
therubyracer (0.9.9)
|
||||||
|
libv8 (~> 3.3.10)
|
||||||
thor (0.14.6)
|
thor (0.14.6)
|
||||||
tilt (1.3.3)
|
tilt (1.3.3)
|
||||||
tinymce-rails (3.4.8)
|
tinymce-rails (3.4.8)
|
||||||
|
@ -293,6 +296,7 @@ DEPENDENCIES
|
||||||
sinatra
|
sinatra
|
||||||
spork
|
spork
|
||||||
sprockets
|
sprockets
|
||||||
|
therubyracer
|
||||||
tinymce-rails
|
tinymce-rails
|
||||||
uglifier
|
uglifier
|
||||||
watchr
|
watchr
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
class NccuCalendar
|
class NccuCalendar
|
||||||
|
require 'open-uri'
|
||||||
@queue = :high
|
@queue = :high
|
||||||
|
|
||||||
def self.perform()
|
def self.perform()
|
||||||
# sleep 10
|
File.open(File.join(Rails.root, 'public/static', 'nccu_calendar.rss'),'w') do |file|
|
||||||
puts "NccuCalendar Sync"
|
file << open('http://events.nccu.edu.tw/Feed').read
|
||||||
|
CronMail.time_check("NCCU Calendar synced").deliver
|
||||||
|
end
|
||||||
|
puts "NccuCalendar Synced"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,4 +11,4 @@ mid_host = {
|
||||||
:database => "RSS23_NCCU_MIDDLE",
|
:database => "RSS23_NCCU_MIDDLE",
|
||||||
:encoding => "UTF8"
|
:encoding => "UTF8"
|
||||||
}
|
}
|
||||||
MID_CLIENT = Mysql2::Client.new(mid_host)
|
#MID_CLIENT = Mysql2::Client.new(mid_host)
|
||||||
|
|
|
@ -5,7 +5,7 @@ do_mail_matt:
|
||||||
description: Runs the perform method in FetchTime
|
description: Runs the perform method in FetchTime
|
||||||
|
|
||||||
nccu_daily_ldap_sync:
|
nccu_daily_ldap_sync:
|
||||||
cron: 30 * * * * *
|
cron: * * [0,12] * * *
|
||||||
class: SyncDb
|
class: SyncDb
|
||||||
args:
|
args:
|
||||||
description: Runs the perform method in SnycDB
|
description: Runs the perform method in SnycDB
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<title>國立政治大學校園活動行事曆</title>
|
||||||
|
<link rel="alternate" href="http://events.nccu.edu.tw/" />
|
||||||
|
<subtitle>本日最新活動</subtitle>
|
||||||
|
<dc:language>zh-tw</dc:language>
|
||||||
|
<entry>
|
||||||
|
<title>2012年世界狂歡節-「框」住瞬間「框」住世界</title>
|
||||||
|
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2901&key2=20120508" />
|
||||||
|
<author>
|
||||||
|
<name />
|
||||||
|
</author>
|
||||||
|
<summary type="text">101/05/01-101/05/08 00:00-23:59</summary>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<title>2012年世界狂歡節-環友世界</title>
|
||||||
|
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2902&key2=20120508" />
|
||||||
|
<author>
|
||||||
|
<name />
|
||||||
|
</author>
|
||||||
|
<summary type="text">101/05/01-101/05/10 00:00-23:59</summary>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<title>2012年世界狂歡節-從政大看台灣</title>
|
||||||
|
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2903&key2=20120508" />
|
||||||
|
<author>
|
||||||
|
<name />
|
||||||
|
</author>
|
||||||
|
<summary type="text">101/05/01-101/05/10 08:00-22:00</summary>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<title>2012年世界狂歡節-美食嘉年華</title>
|
||||||
|
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2905&key2=20120508" />
|
||||||
|
<author>
|
||||||
|
<name />
|
||||||
|
</author>
|
||||||
|
<summary type="text">101/05/08-101/05/10 12:00-14:00</summary>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<title>2012年世界狂歡節-「原,夜」晚會</title>
|
||||||
|
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2906&key2=20120508" />
|
||||||
|
<author>
|
||||||
|
<name />
|
||||||
|
</author>
|
||||||
|
<summary type="text">101/05/08 19:00-21:00</summary>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<title>2012年世界狂歡節-開幕式</title>
|
||||||
|
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2907&key2=20120508" />
|
||||||
|
<author>
|
||||||
|
<name />
|
||||||
|
</author>
|
||||||
|
<summary type="text">101/05/08 12:10-13:30</summary>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<title>職場講座「數位文本實務課程」</title>
|
||||||
|
<link rel="alternate" href="http://events.nccu.edu.tw/more.do?key=2874&key2=20120508" />
|
||||||
|
<author>
|
||||||
|
<name />
|
||||||
|
</author>
|
||||||
|
<summary type="text">101/04/24-101/05/15 12:20-13:50</summary>
|
||||||
|
</entry>
|
||||||
|
</feed>
|
||||||
|
|
Reference in New Issue