Created
June 21, 2017 15:49
-
-
Save gsora/7fc097db4e6ffe746237a73c907eb039 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
#!/usr/bin/env python3 | |
import requests | |
import json | |
import datetime | |
import time | |
address="c269433f56c29d752ce59895edce82fa992f9dcdc2734a8e6a9ee337b7e44de33c3afe193883" | |
dataURL="https://siamining.com/api/v1/addresses/" | |
intervals={ | |
300:"5 minutes", | |
900: "15 minutes", | |
3600: "60 minutes", | |
21600: "6 hours", | |
86400: "24 hours" | |
} | |
resp = requests.get(dataURL+address) | |
j = json.loads(resp.text) | |
print("Mining results:") | |
print("address: {}".format(address)) | |
print("balance: {0:.8f}".format(float(j["balance"]))) | |
print("paid: {0:.8f}".format(float(j["paid"]))) | |
print("valid shares: {}".format(j["valid_shares"])) | |
print("invalid shares: {}".format(j["invalid_shares"])) | |
print("stale shares: {}".format(j["stale_shares"])) | |
print() | |
r = j["intervals"] | |
print("Rewards:") | |
for i in r: | |
print(intervals[i["interval"]] + ": {:.2f} SC -> {:.2f} MH/s".format(i["rewards"], i["hash_rate"]/1000000)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment