2012-05-07 02:23:16 +00:00
|
|
|
# require 'open-uri'
|
|
|
|
# require 'nokogiri'
|
2012-05-08 03:31:35 +00:00
|
|
|
class FetchTime < Resque::Plugins::RestrictionJob
|
|
|
|
restrict :per_300 => 10
|
|
|
|
|
|
|
|
@queue = :low
|
2012-04-13 04:10:47 +00:00
|
|
|
|
|
|
|
def self.perform()
|
2012-05-07 02:23:16 +00:00
|
|
|
# sleep 10
|
2012-05-08 03:31:35 +00:00
|
|
|
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
|
2012-04-13 04:10:47 +00:00
|
|
|
end
|
|
|
|
end
|