Method: God::Contacts::Twitter#notify

Defined in:
lib/god/contacts/twitter.rb

#notify(message, time, priority, category, host) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/god/contacts/twitter.rb', line 27

def notify(message, time, priority, category, host)
  begin
    ::Twitter::Base.new(Twitter.settings[:username], 
                        Twitter.settings[:password]).update(message)

    self.info = "sent twitter update as #{Twitter.settings[:username]}"
  rescue => e
    self.info = "failed to send twitter update from #{self.twitter_id}: #{e.message}"
  end
end