Howto: Steemit Bot Tutorial For Newbies #1 - Votebot

This guide is meant to teach you, how to employ your own bot-agents for Steemit.
It's not the first guide of this kind ...
I will try to explain everything so that you need no prior experience at all.
All you need is a running version of Windows (maybe mac), an internet connection and some time.

In this first episode I will try to explain, how to employ a simple votebot, like in this guide by @xeroc

@xeroc/upvote-bot-in-less-than-10-lines-of-code

I will not add anything to that script, but show how to actually run it on your computer at home.
I have written something similar on this blog before, but apparently failed to communicate, how really anybody can start developing with Python 3 and Piston.


Note:
Until some months ago, before I knew Steemit, I had been completely ignorant of Linux.
I was a Windows-user.
I also have very limited experience in programming.
This guide should work for most newbies.



For this guide I will use Ubuntu 16.04.1 in a virtual machine.
You will not need any prior experience with Linux, though.

Note: This is not the only way to do it and it might not be the easiest.
Because you can use Linux for other stuff too, I think it's a good way of introduction.

Step 1:

Environment

Download VMware Workstation and an Ubuntu 16.04.1 iso.
Install Ubuntu in a virtual machine.
This procedure is well documented all over the internet.
I just hope you can figure that out by searching the web.

If it all works right, you get to choose the virtual hardware for the machine.

I put it to:

  • 1 Processor
  • 2 Gig RAM
  • 20 G HD

That should be sufficient.

It should then look like this:

This way, you have a nice development environment.
If anything was to go wrong, you could just kill the virtual machine and start over again.

Step 2:

Piston

Documentation for Piston:
https://piston.readthedocs.io/en/stable/

Open a terminal with ctrl+alt+T.

Install Piston:
https://piston.readthedocs.io/en/stable/installation.html

It says this command will install piston:

pip3 install steem-piston

It will return an error:

The program 'pip3' is currently not installed [...]

This friendly message also tells us, how to fix it.
Type:

sudo apt install python3.pip

Confirm with your password.
Confirm with 'Y'.

Once that is done, retry

pip3 install steem-piston

It should work now - Yet, it doesn't.
Another friendly error message tells us what to do.

pip install --upgrade pip

This will cause another error message.
This one tells us to try this:

sudo apt install python-pip

Confirm with your password.
Confirm with 'Y'.

This still won't work.
This will fix it:

sudo apt-get install build-essential libssl-dev libffi-dev python-dev

retry

pip3 install steem-piston

This should work, finally

piston --help

This should show you some of Piston's functions.

Some steps above were somewhat pointless, but this is the route I took.
This way it's reproducable at least ( I hope ).

Step 3

Python

We don't want to use Piston 'by hand' though - We want to automate it, right ?

You will need to create a new script.

gedit votebot.py

Will open an editor and a new file called 'votebot.py'.
This is my modified version of @xeroc 's example.
(I don't know how the environmental variables work)

from steem.steem import Steem
import os
import json
steem = Steem(wif="5yourpostingkeyhere")
authors = "felixxx", "deutschbot"
for c in steem.stream_comments():
    if c["author"] in authors:
        print(c.upvote(weight=100, voter="votebot"))

Important:

You will need to put your posting key into this script.
I don't know how safe this method is.
I can therefore NOT recommend it.
Use entirely at your own risk


Replace 5yourpostingkeyhere with your posting key.
Replace votebot with the account the above posting key belongs to.

After

authors = 

replace the list of authors with your favourite authors. (Keep the format)

Save the file.

Step 4

Finished !

Run your script like this:

python3 votebot.py

This bot will crash after a while.
Also, it's very simple and will vote any of the authors' posts, even the comments.

In terms of value, I would not recommend this approach for voting.

This is meant for educational purpose, mainly.

In the next episode I will try to explain, how to modify the bot, to make it act a little smarter.
That will mostly be about Python.

Ultimately the goal is to educate the readers of these posts to come up with their own modifications.

I doubt it would hurt Steemit, if more people joined the bot-game.

Especially, if those bots did more than just voting anything from a list.

Please also keep in mind: For this to work 24/7, your computer will need to run 24/7.
I imagine this to be a very annoying solution for most users.

Please let me know, if this tutorial worked for you.
I hope, I didn't make any mistakes.

H2
H3
H4
3 columns
2 columns
1 column
53 Comments