# require 'open-uri'
# require 'nokogiri'
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
  end
end