Add resque job for NTU GA Announcemnet feed
This commit is contained in:
parent
22b95d4b22
commit
d10b647661
|
@ -0,0 +1,7 @@
|
||||||
|
class GetAnnouncementFromNtuGaRss
|
||||||
|
@queue = :high
|
||||||
|
|
||||||
|
def self.perform()
|
||||||
|
%x(ruby "#{Rails.root}/vendor/built_in_modules/announcement/lib/rss_ntu_ga_aggregate.rb")
|
||||||
|
end
|
||||||
|
end
|
|
@ -33,3 +33,9 @@ get_announcement_from_rss:
|
||||||
class: GetAnnouncementFromRss
|
class: GetAnnouncementFromRss
|
||||||
args:
|
args:
|
||||||
description: Loop through the announcement RSS until 24h ago
|
description: Loop through the announcement RSS until 24h ago
|
||||||
|
|
||||||
|
get_announcement_from_ntu_ga_rss:
|
||||||
|
cron: 0 0 [2,12] * * *
|
||||||
|
class: GetAnnouncementFromNtuGaRss
|
||||||
|
args:
|
||||||
|
description: Update announcement RSS to primary NTU_GA site
|
||||||
|
|
|
@ -30,7 +30,7 @@ SITES.each do |name, url|
|
||||||
feed.items.each do |item|
|
feed.items.each do |item|
|
||||||
category = item.category.to_s.gsub(/\<(\/)*category\>/, '')
|
category = item.category.to_s.gsub(/\<(\/)*category\>/, '')
|
||||||
|
|
||||||
if item.pubDate > two_weeks_ago
|
if item.pubDate > yesterday
|
||||||
recent_feed[item.title.strip] = { date: item.pubDate, description: item.description.gsub("\r\n", '<br/>').strip,
|
recent_feed[item.title.strip] = { date: item.pubDate, description: item.description.gsub("\r\n", '<br/>').strip,
|
||||||
link: item.link, category: category }
|
link: item.link, category: category }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue