Last active
June 19, 2017 04:12
-
-
Save seymores/4cf112d09262a615c3cbf39b91e01207 to your computer and use it in GitHub Desktop.
Ethermine BitBar Plugin
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
#!/usr/bin/env ruby | |
# <bitbar.title>Ethermine BitBar Plugin</bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>Seymour Cakes</bitbar.author> | |
# <bitbar.author.github>https://gist.github.com/seymores/4cf112d09262a615c3cbf39b91e01207</bitbar.author.github> | |
# <bitbar.desc>Quick latest hashrate and unpaid values.</bitbar.desc> | |
# <bitbar.dependencies>ruby,httparty</bitbar.dependencies> | |
require 'httparty' | |
address = "YOUR_ETHMINE_ADDRESS_HERE" | |
url = "https://ethermine.org/api/miner_new/#{address}" | |
response = HTTParty.get(url) | |
output = response.parsed_response | |
hashrate = output['hashRate'] | |
up = output['unpaid'] | |
unpaid = (up.to_f/1000000000000000000).round(6) | |
puts "#{unpaid} @ #{hashrate}" | |
puts "---" | |
puts "#{address} | color=green href=https://ethermine.org/miners/#{address}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment