Posts

Python Libraries: The Random Splash Voter

avatar of @slobberchops
25
@slobberchops
·
0 views
·
4 min read

Following on from the The Anti-@stimialiti Pro-Active and Reactive Counter Tool, I wanted to write something a little more positive, and as I had the routines already in place, how about a Random Splash Voter?

Here I was with FOUR accounts, not working so well for me in terms of efficiency, pro-actively voting up comments knowing full well they were going to be down-voted on day 6 by a slavering @stimialiti who is still trying in vain to confuse my BOT coding.

Coming from a professional background in automation, I love the fact that we can code all this boring stuff and let computers do the menial tasks.

I was finding all of the counter-@stimialiti accounts were being underutilised and so the excess voting power needed to get working for me.

Random Splash Voter is the script I came up with from the remnants of the anti-BOT code, which takes a random account from a pre-defined list, gets the latest post that must have been created in the last 24 hours, and then grants it a 100% vote utilising the accounts from my voters' list.

Yes, that’s quite a mouthful and over-worded I know, so let me break it down.

The accounts @chops.support, @wanker, @bingbabe, @dismayedworld have all had some HP delegated to them, and it needs using up on the right kinds of content.

The script is kicked off manually, gets a random account using this quite simple line, and then checks all FOUR accounts for their voting power levels.

The random account’s posts are obtained that are pending rewards and all are discarded except for the latest one. If that is older than 24 hours then that is also ignored.

…'well... I want full curation for my votes, you can't blame me!'…

If a suitable post is found then each account will bestow a 100% vote if its voting power is above 75%.

Some HIVE users may have already noticed these votes randomly splashing on their content, and if so you are already part of the voting list.

One problem I did encounter was duplicate voting. For example, if a post has a vote of 50% from an account and then the same weight is attempted again, Python will throw an exception.

I was using a Try: statement to begin to get around this but issues were creeping in if the post was voted twice at different weights.

In this case, the second vote overwrites the first one, nullifying it and denying the voter of curation rewards on the second vote.

...**'HasAuthorVoted returns a Boolean True or False, and takes the parameters of the voter and post data'*...

I had to find a more elegant solution than using Try: as it's lazy arse coding and came up with a function that checks the post, enumerates the voters, and returns a Boolean value to the function call.

What I noticed while doing this was when I ran the code, ‘voterlist’ returns a list but it’s really a dictionary.

Enumerating it using dictionary parsing methods such as .keys and .values were all failing so I had to use list commands.

I still don’t understand why the (type(voterlist)) command returns a list, so please feel free to educate me.

I have added this routine (above) which can be slotted into anyone’s code.

Lastly, the whole main section is ran by a loop which keeps going until all the accounts are below 75% VP. So I can kick it off, go and have a shower and it's all done when I get out.

For Python veterans, I suppose all this is quite noddy stuff but I am finding it interesting and have that drive to learn more.

If you have read this far and am not a programmer then your eyes are probably glazed over and you need more coffee, so let’s get to the more interesting part.

After raiding @steevc's @tenkminnows voting list I now have quite an extensive list of HIVE accounts in my ‘votees’ list but would like some more.

Adding your account to the list gives no guarantee of votes as by design this is a random voter but I can tell you that when I run this script, it passes by many posts as they don't make the criteria.

They are too old, they have already been voted or the VP of the voting accounts is too low. It does skip a lot of content!

*...'sorry @normie.fitness, I will get you next time when the VP level's have gone up some'...

If you want some free votes, are not a spammer, can generate something that people want to read, don't cash out all your rewards, am not already being followed by ME, respond to comments, are not an arsehole, and are generally ignored then feel free to drop me a comment.

I will look over your blog and add you to the list if all the criteria above is met (especially the second to the last one).

Don’t expect massive votes, as these accounts are not large ones, but they will help.

- Earn currency while you play brewing virtual beer with [CryptoBrewMaster](https://www.cryptobrewmaster.io/game/invite?ref=9846a8af82df4dd0bc23192a135df232&code=AlphaBonus) - Earn currency while you play and become a global Rock Star with [Rising Star](https://www.risingstargame.com?referrer=slobberchops)

If you found this article so invigorating that you are now a positively googly-eyed, drooling lunatic with dripping saliva or even if you liked it just a bit, then please upvote, comment, rehive, engage me or all of these things.