Python-Steem Example: Your Curation HighscoresteemCreated with Sketch.

in #python-steem8 years ago

The new Python-Steem 0.4 is out, but I think it could use more examples.
As I try out the new functions, I thought it would be helpful, to post some working code.

This script uses the classes Account and Amount that were part oft steemtools by @furion.

The longest part was to build the url.

Code

from steem import Steem
steem = Steem(node="wss://node.steem.ws") #temporary fix (usually: wss://this.piston.rocks )
from steem.account import Account
from steem.amount import Amount

account = Account("felixxx")

best = 0

for event in account.history(filter_by='curation_reward'): 
    reward = account.converter.vests_to_sp(Amount(event['reward']).amount)
    if reward > best:
        best = reward
        link = ("https://steemit.com/tag/@" + event['comment_author'] + '/' + event['comment_permlink'])

print('\nYour curation-highscore: ' + str(best) + ' SP\nfor ' + link +'\n')

Just replace felixxx with your account name and run.


Result*

*The curation reward shown in Steem Power might be slightly wrong, since the script uses the reward VEST values

Sort:  

Thanks!
Your curation-highscore: 1.0266766921192612 SP for https://steemit.com/tag/@steemvoter/steemvoter-open-sourcing-python-components-and-browser-compatibility-updates

Did you ever find a golos API ?

i didn't even register for golos ...

Ah, ok sorry i thought you were working on something for golos. I must have been mistaken :)

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 62102.06
ETH 2415.08
USDT 1.00
SBD 2.49