Python-Steem Example: Your Curation HighscoresteemCreated with Sketch.

in python-steem •  8 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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Upvote und resteemd

Danke :)

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

I just got python-steem installed on my Ubuntu. Needed a few other things, but it's working now. My best curation was 0.56 SP :)

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 :)