Simple Python Voting For When Steemit Is Down

in #steem6 years ago (edited)

With this morning's steemit api issues I found myself needing to vote on some posts and no easy solution. Both steemit and busy were down as apparently they both rely on the same api to log in. So at just after 6am this morning I decided to rip pieces out of my voting bot and do the voting manually. This is the condensed (but still working) version of the commands I used. This assumes you know the permalink of the post or have a source to get it from like https://steemd.com

The code itself is simple:


from piston import Steem
wss = "wss://steemd.privex.io"
voter = ["username", "private posting key"]
steem = Steem(node=wss, keys=voter[1])
vote_weight = 50.0
comment = steem.get_post("permalink")
comment.vote(vote_weight, voter[0])

Some notes:
Replace the wss://steemd.privex.io with any working node. You can find a list of them below the chart here: http://www.steemreports.com/steem-rpc-monitor/
If you don't know what the permalink is it's pretty much the url from the @ on. For example for this post it is: @fubar-bdhr/simple-python-voting-for-when-steemit-is-down
I use the piston lib. If you are using steempython commands might not match.
voting_weight is the percentage you want to vote with. In this example I voted with 50%
replace username is your steem username you want to vote with and private key with the steem private posting key for that account.

That's it just a few simple commands. You can just repeat the comment.get_post and comment.vote commands to vote on more posts. Don't need to repeat the others.

Coin Marketplace

STEEM 0.28
TRX 0.13
JST 0.032
BTC 60725.43
ETH 2900.91
USDT 1.00
SBD 3.59