Viewing a response to: @slobberchops/python-libraries-simple-display-your-splinterlands-dec
Well, you piqued my interest! This got me to install Python 3 and, using PIP to add the requests repository. After all that I thought I would contribute by adding a total... Altered the code as follows: import json, requests splinterlands_accounts = ["account1", "account2", "account3"] print("----------------------------------") print("Account DEC Total") print("----------------------------------") totalDEC = float("0") for account in splinterlands_accounts: url = "https://api2.splinterlands.com/players/balances?username=" + account spldata = json.loads(requests.get(url).text) for data in spldata: if data["token"] == "DEC": spaces = " " * (20-len(data['player'])) print("{} {} {}".format(data['player'], spaces, data['balance'])) totalDEC = totalDEC + float(data['balance']) print("----------------------------------") spaces = " " * (18-len(str(totalDEC))) print("{} {} {}".format("Total DEC", spaces, str(totalDEC))) print("----------------------------------")
author | onw |
---|---|
permlink | re-slobberchops-rjyipa |
category | hive-163521 |
json_metadata | {"tags":["hive-163521"],"app":"peakd/2022.10.1"} |
created | 2022-10-18 16:20:03 |
last_update | 2022-10-18 16:20:03 |
depth | 1 |
children | 1 |
last_payout | 2022-10-25 16:20:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.061 HBD |
curator_payout_value | 0.061 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,051 |
author_reputation | 15,954,360,789,244 |
root_title | "Python Libraries: Simple... Display your Splinterlands DEC " |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 117,575,119 |
net_rshares | 204,008,716,608 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
slobberchops | 0 | 204,008,716,608 | 5% | ||
florezjvu | 0 | 0 | 100% |
Great, have a go at doing something else, and install the BEEM library.., then you can truly manipulate HIVE stuff.
author | slobberchops |
---|---|
permlink | re-onw-rjymlm |
category | hive-163521 |
json_metadata | {"tags":["hive-163521"],"app":"peakd/2022.10.1"} |
created | 2022-10-18 17:44:12 |
last_update | 2022-10-18 17:44:12 |
depth | 2 |
children | 0 |
last_payout | 2022-10-25 17:44:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 115 |
author_reputation | 2,427,110,227,685,880 |
root_title | "Python Libraries: Simple... Display your Splinterlands DEC " |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 117,577,240 |
net_rshares | 0 |