Created
June 23, 2017 06:56
-
-
Save alea12/94a1e970e26d5a659b9bdc629b3fb498 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'open-uri' | |
require 'slack-notifier' | |
url = ENV["ETHERMINE_API_URL"] | |
json = JSON.load(open url) | |
message = "Unpaid Balance: #{json['unpaid'] / 10.0 ** 18} ETH \n" | |
json['workers'].each do |worker, status| | |
message << "#{worker}: #{status['hashrate']} \n" | |
end | |
notifier = Slack::Notifier.new(ENV["SLACK_WEBHOOK_URL"]) | |
notifier.ping message.strip! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment