steem-python: check your post upvotes

in steem •  7 years ago 

Hello,

Maybe you have already seen my previous experiments with the steem-python library. My first post about my steem-python experiments got my highest upvote ever. It's currently over 15$. But I wanted to know more about all upvotes of this post. Let's write a script ;-)

To calculate the amount of sdb each vote gives you I found this post from @penguinpablo. It describes what parameters are needed and how they're calculated. Thanks. Very good post, you should read it.
In short at the moment of the upvote there is a value called rshares stored in the blockchain. This value describes the current power (from his SP and VP) of the vote. The absolute amount also depends on the Steem reward pool and the total recent rshares amount and the current steem price.
This means that the value is kinda dynamic and will change over time. When you look at the same post tomorrow and the votes didn't change there could still be another value there. So when you try my script you need to first adapt these three values. You can check them from steemd.com.

So In my script I wanted to calculate each sdb that comes out of each vote and show it in a .html file.

The result
The result is a list in a .html file that shows all the upvotes including the sbd calculated from the rshares at the time of the vote. What I found out looking at my post is that I got a first vote from a whale. Yeay.

Hm...
This might actually not be very interesting for you. But you can run the script against other posts from other users, for example let's check meet-steem-s-top-10-witnesses from @jerrybanfield which got more than 500$ on upvotes. I applied a small filter to only see upvotes larger than 5sdb:

screen_shot_jerry.png

In total the post has more than 1000 votes. But we can see here that roughly spoken 85% of the outcoming sdb comes only from 12 big upvoters. Does this conclude that you can only get a high paying post with upvotes from a whale?

The code (simplified)

#The starts with getting all the voters for a post:
voters = s.get_active_votes(ACCOUNT_NAME, POST_NAME)

#Preparing the file to write
file = open('upvoters_post_{}_{}.html'.format(ACCOUNT_NAME, timestamp), 'w')
file.write('<HTML-CONTENT-START>')

#Counter for the total sdb
count_sdb = 0.0

#Loop over the voters and get the vote details, write the html content.
for voter in voters:
    name = voter['voter']
    percent = voter['percent']
    rshares = voter['rshares']
    time = voter['time']
    current_sdb = float(rshares) * rshares_sdb_value
    count_sdb = count_sdb + current_sdb
    file.write('<WRITE-HTML-CONTENT-ROW>')

file.write('<WRITE-HTML-TOTAL-ROW>'')
file.write('<WRITE-HTML-END>')
file.close()



The script is on my github account: post_upvoters.py

To run this script you need python3 and steem-python installed. Before you start the script adapt it to your ACCOUNT_NAME and POST_URL.
Also be sure to check the newest values reward_balance, recent_payouts and steem_price to get good measurements of the sdb.

Thanks for reading. Comment or upvote if you like my posts and try out my scripts. Do you have any suggestions for further posts?

In case you missed my other posts about steem-python:

J

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:  

This post recieved an upvote from minnowpond. If you would like to recieve upvotes from minnowpond on all your posts, simply FOLLOW @minnowpond

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by jjb777 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews/crimsonclad, and netuoso. The goal is to help Steemit grow by supporting Minnows and creating a social network. Please find us in the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

This post received a 3% upvote from @randowhale thanks to @jjb777! For more information, click here!

Congratulations @jjb777! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

I am trying to include my code on apache2 server. But the server gives a internal server error. Can you help with it

Check the apache error log file (in apache/logs) for more info and google for the cause. J

This post has received a 3.34 % upvote from @buildawhale thanks to: @jjb777. Send 0.100 or more SBD to @buildawhale with a post link in the memo field to bid on the next vote.

To support our curation initiative, please vote on my owner, @themarkymark, as a Steem Witness

very interesting. I cannot run the script at this point as I need to install the programs mentioned but will for sure try this as early as possible.

Yes. Ull need to install python3 and the modules. J