God , Resque, Resque-schedule, is working,but buggy. Need to combine with LDAP and also implement XML calendar sync.

This commit is contained in:
Matthew K. Fu JuYuan authored and Christophe Vilayphiou committed 2012-05-08 20:26:36 +08:00
1 parent dbac219c18
commit 7af17f19ac
5 files changed
+27 -13

No files matched your search

+8 -6
View File
@@ -1,13 +1,15 @@
# require 'open-uri'
# require 'nokogiri'
module FetchTime
@queue = :my_job_queue
class FetchTime < Resque::Plugins::RestrictionJob
restrict :per_300 => 10
@queue = :low
def self.perform()
# sleep 10
# doc = Nokogiri::HTML(open('http://www.timeanddate.com/worldclock/city.html?n=241'))
# CronMail.time_check(doc.at('#ct').children.first.text).deliver
# puts "Mail Sent"
# true
doc = Nokogiri::HTML(open('http://www.timeanddate.com/worldclock/city.html?n=241'))
CronMail.time_check(doc.at('#ct').children.first.text).deliver
puts "Mail Sent"
true
end
end