I have to admit todays code is mostly a copy from @felixx homework post. I did change the code to use the steemit api for the data as the default beem api timed out. I also tried to run the program against the testnet, but it appears that @mytechtrail does not have any data in the database.  ```python from beem.account import Account from beem.blockchain import Blockchain from beem import Steem from beem.instance import set_shared_steem_instance #steemit_api = Steem(node=["https://testnet.steemitdev.com"]) steemit_api = Steem(node=["https://api.steemit.com"]) set_shared_steem_instance(steemit_api) blockchain = Blockchain() head_block = blockchain.get_current_block_num() test_account = Account("mytechtrail") rewards = [] reward_sum = 0 for curation_reward in test_account.history_reverse(start = head_block, stop = head_block - 30000, use_block_num = True, only_ops = "curation_reward"): rewards.append(curation_reward['reward']['amount']) for reward_num in range(10): # starts at 0 reward_sum += int(rewards[reward_num]) print('\n', reward_num + 1, ':', rewards[reward_num]) print('\naverage:', reward_sum/ 10, '\n... this look like its in VESTS ...') ```
author | mytechtrail |
---|---|
permlink | teaching-myself-python-day-7 |
category | ulog |
json_metadata | {"app":"steempeak/1.19.0","format":"markdown","tags":["ulog","marlians","palnet","python","stem","ctp"],"users":["felixx","mytechtrail"],"links":["/@felixx","/@mytechtrail"],"image":["https://files.steempeak.com/file/steempeak/mytechtrail/4B7DUQ9J-pylearn-day7.png"]} |
created | 2019-11-06 04:40:30 |
last_update | 2019-11-06 04:40:30 |
depth | 0 |
children | 1 |
last_payout | 2019-11-13 04:40:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.155 HBD |
curator_payout_value | 0.153 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,289 |
author_reputation | 18,997,364,795,810 |
root_title | "Teaching myself Python Day 7" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 92,242,129 |
net_rshares | 1,581,459,006,866 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
felixxx | 0 | 584,228,187,523 | 100% | ||
rishi556 | 0 | 29,020,374,705 | 100% | ||
steembasicincome | 0 | 335,483,253,743 | 15.86% | ||
conradsuperb | 0 | 5,880,098,767 | 10% | ||
kabir88 | 0 | 362,894,209,831 | 100% | ||
dmxmaster | 0 | 574,575,828 | 100% | ||
flaxz | 0 | 21,099,957,578 | 50% | ||
blainjones | 0 | 523,022,841 | 100% | ||
gadrian | 0 | 60,927,917,686 | 25% | ||
wirago | 0 | 10,726,536,090 | 100% | ||
solominer | 0 | 20,019,190,490 | 3% | ||
nordal | 0 | 598,247,421 | 100% | ||
amir01 | 0 | 460,735,834 | 100% | ||
constant-flux | 0 | 20,802,473 | 37.5% | ||
brendanweinhold | 0 | 102,385,156 | 100% | ||
dkkarolien | 0 | 72,979,924,702 | 100% | ||
kendra19 | 0 | 2,386,270,113 | 100% | ||
s77assistant | 0 | 30,807,448,171 | 42.28% | ||
abh12345.stem | 0 | 190,465,418 | 25% | ||
thranax | 0 | 22,350,090,283 | 37.5% | ||
ph1102.ctp | 0 | 105,430,128 | 20% | ||
clicktrackprofit | 0 | 16,890,302,870 | 50% | ||
sbi-tokens | 0 | 126,864,809 | 5.15% | ||
curation.stem | 0 | 95,553,626 | 75% | ||
cryptopassionctp | 0 | 103,598,737 | 40% | ||
freedomteam2019 | 0 | 2,515,408,377 | 100% | ||
yggdrasil.laguna | 0 | 326,603,902 | 70% | ||
curpal | 0 | 21,549,764 | 10% |
How is your experience so far? Never really got warm with python although I am working with C# and js a lot ^^ Posted using [Partiko Android](https://partiko.app/referral/wirago)
author | wirago |
---|---|
permlink | wirago-re-mytechtrail-teaching-myself-python-day-7-20191106t085034688z |
category | ulog |
json_metadata | {"app":"partiko","client":"android"} |
created | 2019-11-06 08:50:36 |
last_update | 2019-11-06 08:50:36 |
depth | 1 |
children | 0 |
last_payout | 2019-11-13 08:50:36 |
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 | 179 |
author_reputation | 100,317,999,792,316 |
root_title | "Teaching myself Python Day 7" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 92,246,797 |
net_rshares | 0 |