mrkrabs.rb - Self Voting Bot

Words
521
Reading
3 min
Listen
Play
9y

Mr. Krabs is a reimplementation of Dr. Phil, but instead of voting for new articles, it self-votes for posts and comments you write, after certain rules are met. By default, it votes for posts that reach 60 votes or is 6 days old. The default for comments is 6 votes or 6 days old.

Features

  • YAML config.
    • voting_rules
      • vote_weight a static percentage (like 100.00 %)
      • history_limit used to set how far back to look in account history.
      • enable_comments option to vote for post replies (default false).
      • min_post_age allows you to only upvote once a post has reached a certain age
      • min_comment_age allows you to only upvote once a comment has reached a certain age
      • min_post_votes allows you to only upvote once a post has reached a certain number of votes
      • min_comment_votes allows you to only upvote once a comment has reached a certain number of votes
      • poll_time how often to check for new content (in seconds)
    • accounts List of accounts to vote on, e.g: account wif
      • Or use accounts: accounts.txt
        • The format for the file is just: account wif (no leading dash, separated by space)

Overview

The goal is to vote after the rules have been met. Setting 60 votes or 6 hours will have Mr. Krabs vote in either situation, whichever happens first.


Install

To use this Radiator bot:

Linux
$ sudo apt-get update
$ sudo apt-get install ruby-full git openssl libssl1.0.0 libssl-dev
$ sudo apt-get upgrade
$ gem install bundler
macOS
$ gem install bundler

You can try the system version of ruby, but if you have issues with that, use this how-to, and come back to this installation at Step 4:

I've tested it on various versions of ruby. The oldest one I got it to work was:

ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-darwin14.4.0]

Setup

First, clone this gist and install the dependencies:

$ git clone https://gist.github.com/acc37590f160842afb5528eb2c63a636.git mrkrabs
$ cd mrkrabs
$ bundle install

Then run it:

$ ruby mrkrabs.rb

Mr. Krabs will now do it's thing. Check here to see an updated version of this bot:

https://gist.github.com/inertia186/acc37590f160842afb5528eb2c63a636


Upgrade

Typically, you can upgrade to the latest version by this command, from the original directory you cloned into:

$ git pull

Usually, this works fine as long as you haven't modified anything. If you get an error, try this:

$ git stash --all
$ git pull --rebase
$ git stash pop

If you're still having problems, I suggest starting a new clone.


Troubleshooting

Problem: What does this error mean?
mrkrabs.yml:1: syntax error, unexpected ':', expecting end-of-input
Solution: You ran ruby mrkrabs.yml but you should run ruby mrkrabs.rb.

Problem: Everything looks ok, but every time Mr. Krabs tries to vote, I get this error:
Unable to vote with <account>.  Invalid version
Solution: You're trying to vote with an invalid key.

Make sure the .yml file voter items have the account name, followed by a space, followed by the account's WIF posting key. Also make sure you have removed the example accounts (social and bad.account are just for testing).

Problem: The node I'm using is down.

Is there a list of nodes?

Solution: Yes, see:

https://steem-third-party.github.io/steem-servers/




Image Source: ekarasz.deviantart.com

See my previous Ruby How To posts in: /f/ruby

Get in touch!

If you're using Mr. Krabs, I'd love to hear from you. Drop me a line and tell me what you think! I'm inertia@inertia on STEEM and SteemSpeak.

License

I don't believe in intellectual "property". If you do, consider Mr. Krabs as licensed under a Creative Commons CC0 License.

mrkrabs.rb - Self Voting Bot | Ecency