Python-Steem Example: Countervote @asshole
py-steem·@felixxx·
0.000 HBDPython-Steem Example: Countervote @asshole
In case you didn't already know, a new user named @asshole downvotes all sorts of comments on steemit.
This morning @englishtchrivy contacted me in Steemit.chat and gave me a nice idea for an example script.
I modified my followvotes - script from here:
https://steemit.com/python/@felixxx/python-steem-example-follow-votes
The new script watches all votes by @asshole, checks the vote's weight and then goes on to negate that vote.
http://i.imgur.com/ExcpMaC.png
# Code
from steem import Steem
from steem.blockchain import Blockchain
chain = Blockchain()
assholes = ["asshole"]
pk = ["5HUz4TRlolyouwish778tzU754J94ngb8lme9"]
account = ["votebot"]
steem = Steem(keys=pk[0], node="wss://node.steem.ws")
for operation in chain.ops():
op = operation["op"]
if op[0] == "vote":
#print(op) #uncomment this to see the structure of a vote operation
comment_voter = op[1]["voter"]
if comment_voter in assholes:
comment_link = op[1]["permlink"]
comment_author = op[1]["author"]
vote_weight = int(op[1]["weight"]/100)
comment = steem.get_post("@" + comment_author + "/" + comment_link)
print("asshole downvoted " + comment_link + " weight:" + str(vote_weight))
for (k,v) in enumerate(account):
try:
steem = Steem(keys=pk[k], node="wss://node.steem.ws")
vote_weight = (vote_weight * (-1))
comment.vote(vote_weight, v)
print("... countered with " + v + " with " + str(vote_weight) + "%")
except Exception as e:
print("... NOT countered with " + v + " because: ")
print(str(e))
# Issues
This script will upvote all comments that @asshole downvotes, with the exact same weight.
So when @asshole downvotes 1%, the bot will upvote by 1%.
If @asshole started upvoting comments, this script would downvote the comment.
( that might need a fix )
Ideally, with this bot, it would be easiest to have an account to just counter @asshole with similar SP.
# Conclusion
I will not employ this script, because I don't have a 1K SP account to counter it.
If I countered @asshole with @felixxx in the way above, I would end up upvoting the comment too much, since I have more SP than @asshole.
Also this would drain my voting power.👍 felixxx, asshole, pfunk10, seraph, wang, dunia, ioc, jsg, murh, skeptic, dumar022, fyrstikken, blhz, whatageek, shaka, ericvancewalton, inertia, shortcut, tamersameeh, hulkbuster, bycz, thebatchman, thebatchman1, raymonjohnstone, redpalestino, bola, sazbird, mapipaz, topikzmonster, pollux.one, dwinblood, cryptofunk, opheliafu, bottymcbotface, eem, karenb54, inphiknit, twinner, gammagooblin, ines-f, freiheit50, whiskylover, febird, andrewawerdna, ap2002, elena000, nelyp, skapaneas, gas7uazz, saamychristen, awgbibb, drac59, fiveboringgames, bestofreddit, fisteganos, coldmonkey, acidyo, herbertmueller, nang1, juanmiguelsalas, steemer0815, trans-juanmi, juliosalas, dirkzett, dresden, uwe69, getssidetracked, trees, strawhat, cryptochannel, mrgreen, pokemon, neptun, renzoarg, reisman, dzone, robertneleson, benjiparler, triddin, thegoodguy, allmonitors, lifeworship, proctologic, proctologic2, proctologic3, lovethepeople, porco-bastardo, runridefly, norbu, karenmckersie, edje, busser, kurtbeil, alexandergomez, gutzofter, moon32walker, richardjuckes, alexpmorris, denisoi, riyandi, gargon, lichtblick, meanpeoplesuck, sonzweil, alktoni, tarekadam, steempty, oleg81, madlenfox, steevc, benjojo, jademont, fibra59, katharsisdrill, joshuaatiemo, cardboard, steembriefing, lrock, bhavnapatel68, barvon, venkateshachanta, juneaugoldbuyer, germansailor, stephenkendal, ianstrat, fiona777, jesta, jocelyn, biodragon, joseph, idol, berkah, picokernel, germanlifestyle, tablettenformat, frankches, richman, technium, elyaque, timsaid, achim86, opmonis, oaldamster, the-future, marius19, food-creator, muhtadiaremi, neroru, wagnertamanaha, eeks, nigelmarkdias, titusfrost, dan-atstarlite, klye, bleujay, bones, ace108, englishtchrivy, sward, gildar, tskeene, meysam, kaj-huisman, onezetty, rynow, lordgangler, silviabeneforti, livehonest, grey580, yetaras, visar197, jlufer, vortac, kobold-djawa, liliana.duarte, bitcoiner, koskl, talanhorne, cassidyandfranks, taskmanager, homeartpictures, slobo, jayfox, uwelang, rizkiavonna, mikisolus, social, reeferman, dragon40, kostaslou, afrog, bitcoinparadise, no0balot,