Python-Steem Example: Countervote @assholesteemCreated with Sketch.

in #py-steem8 years ago (edited)

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.

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.

Sort:  

After publishing this, I got downvoted by @asshole by 1%
@seraph and @pfunk10 seem to already counter @asshole.

Those are @anyx and @pfunk accounts, I suppose.

Somebody is already doing the job.
I didn't know that, when I published this.

@felixxx it wasn't just my idea, many Steemians who am often talking to thought the same I just happen to remember you own a bot and a have a huge heart surely you won't say no.
Thank you !

I mainly posted this for my personal profit.
Also because I enjoy learning Python.

I own a few accounts, but they don't hold much Power.

@felixxx that's why I asked you
but which of your account is counteracting that shit bot's vote?
Let's feed it with some SP so it could be more powerful and if the others would do the same just accept that or is it only anyx's bot that may do that now?

anyx has it covered.

Once the comment is upvoted back to 0, there is nothing left to do, really :)

If asshole's goal is test of the spam attack with "nothing at stake", than negating his action means is doubling attack's effect. maybe there is another way to stop flagger - f.e. make them pay for flagging?

If asshole's goal is test of the spam attack with "nothing at stake", than negating his action means is doubling attack's effect

I'm not sure, if I understand this right.
If he 'abuses' 1k SP and we need 1k SP to counter him, then those 2 k SP have no relevance to the reward pool. In that sense the attack leaves 2 k SP useless.
I'm not sure what the effect of this attack is supposed to be, but other than rendering 2k SP useless, there are no effects. ( Slight bloat of the blockchain, but there have been worse attacks than this, before )

make them pay for flagging?

Flagging costs Voting Power.
If he spent the VP on upvoting instead, he could get a reward.

Compared to accounts that upvote, he is losing profit.

Seems this trick is not about profit, he'd already spent $100 for nothing. I mean just bloating the blockchain, I remember last October attacks in ETH.

There was an attack here where somebody posted long posts full of gibberish in rapid succession.
That was bloating the blockchain much more than vote operations.

But I don't know what happened there tbh.


He didn't spend the 100$, he can withdraw them later.

It's annoying, but I don't think there is more to it.

Thank you for posting @felixxx.

bleujay is certain there are means to counter this and it would be especially nice if the Steemit community had measures they used when such tactics are employed. This sounds like a good one...are there others. A countervote seems to be working for bleujay.

Again thank you to @felixxx and @englishtchrivy for their pragmatism...always appreciated.

All the best. Cheers.

Interesting post, and very informative and comprehensive in its content. Sounds like a technology that is likely to become increasingly needed as Steemit develops.

You might want to edit out your POSTING KEY from the code... @the.masses had their key hijacked and used for all kinds of bad things. I'd change it something like ==insert your posting key here==

Just wanted to clarify that @the.masses was a social experiment by @timcliff to see what would happen with an account with its posting key publicized. No hijacking occurred but lots of spam and trolling which lead to eventual shutdown.

Yes, that is correct. Thank you for the correction.

Thanks !

"5HUz4TRlolyouwish778tzU754J94ngb8lme9"
Isn't a real posting key, though :)

Good then. :) Just didn't want your account to get ruined by some jackass posting as you. Or worse, having asshole start using your posting key.

Great Idea. I dont have the steempower but usually do try to push against his flags when I can :)

It makes me feel as if I belong, a right of passage. I would feel left out if everybody else was getting the flag, and I was left alone.

Do you know if there is a way to reverse mute? To disallow selected accounts from seeing anything you do. If someone were flag stalking me, I could make myself invisible to them, instead of getting continually flagged.

All blockchain operations are public.
I can read the blockchain without providing an account myself.

You can not hide your posts, accounts, votes or transfers on the steem blockchain.

How does the mute button work, the one way, but not the other? I'm not looking to hide completely, only make myself less obtrusive to people who carry grudges.

The mute button hides other's accounts from me, I have been trying to talk certain people into muting me. Not in so many words, and to limited effect.

Everything you do on the steem blockchain is public.

You can not keep certain accounts from seeing what you do on steemit.

I hope i don't get down voted by any one :)
I am a peaceful geek...


You can check Daniel Satori script Counter Flag to implement the control of VP and the relation SP to Vote weight you need to counter whatever you want to counter.

Alternatively, you can also implement check to skip UP-Votes like this:

if not int(op[1]["weight"])

Excellent post dear friend @ felixxx thank you for getting involved in the topic.
I gave you three more names that today were added by putting flags to everyone @topikzmonster, @ livehonest, @ livemoral
You can verify for yourself in the link
https://steemd.com/@livemoral
https://steemd.com/@livehonest
https://steemd.com/@topikzmonster
I hope this information helps

Coin Marketplace

STEEM 0.23
TRX 0.21
JST 0.035
BTC 98823.85
ETH 3347.31
USDT 1.00
SBD 3.15