Created
June 23, 2017 06:56
-
-
Save alea12/b88355937a1cd92577131b5d3939095e to your computer and use it in GitHub Desktop.
This file contains 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