Class: Cinch::Plugins::DownForEveryone

Inherits:
Object
  • Object
show all
Includes:
Cinch::Plugin
Defined in:
lib/cinch/plugins/downforeveryone.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ DownForEveryone

Returns a new instance of DownForEveryone.



7
8
9
10
11
12
# File 'lib/cinch/plugins/downforeveryone.rb', line 7

def initialize(*args)
  super

  @agent = Mechanize.new
  @agent.user_agent_alias = "Linux Mozilla"
end

Instance Method Details

#execute(m, url) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/cinch/plugins/downforeveryone.rb', line 15

def execute(m, url)
  if up?(url)
    m.reply "It's just you. #{url} is up."
  else
    m.reply "It's not just you! #{url} looks down from here."
  end
end