Skip to content

Instantly share code, notes, and snippets.

@siyo
Last active December 14, 2015 14:18
Show Gist options
  • Select an option

  • Save siyo/5099762 to your computer and use it in GitHub Desktop.

Select an option

Save siyo/5099762 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
# blink(1) favorite notifier earthquake.gem plugin
#
Earthquake.init do
once do
class Blink1Star
CMD = "blinK1-tool"
OPT_FADE = 10
OPT_DELAY = 50
OPT_BLINK = 50
def setup
system("%s --off -q" % [CMD])
end
def notifier
lambda {
system("%s -m %d -t %d --random %d -q" % [CMD, OPT_FADE, OPT_DELAY, OPT_BLINK ])
system("%s --off -q" % [CMD])
}
end
end
Blink1Star.new.setup
end
output do |item|
next if item.nil? || item["event"].nil? || item["event"]["favorite"].nil?
next if item["source"]["screen_name"] == twitter.info["screen_name"]
EM.defer(Blink1Star.new.notifier)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment