How To Get Started Making a Python Based Steemit Bot on CentOS 7 Using Piston

in #steemit8 years ago

Most of the Steemit documentation and guides seem to be focused on Debian and Ubuntu. While I have great love for those distros I also happen to have a free CentOS 7 server available to me and wanted to start playing around making a Steemit bot. Here are the steps I took to successfully get Piston - The Swiss army knife for the Steem network working on CentOS 7. It wasn't too hard but there were a few packages that needed to be installed first and an annoying workaround to make the pip module work with Python 3.4 since the standard package doesn't work.

Commands:
yum install python34 python34-devel python34-setuptools

curl https://bootstrap.pypa.io/get-pip.py | python3.4

git clone https://github.com/xeroc/piston

cd piston

python3 setup.py install --user

You should now have Piston all setup and ready to start making bots here is their simple example bot:

from piston.steem import Steem
import os
import json
steem = Steem(wif="posting-key-for-default-author")
for c in steem.stream_comments():
    if "Boobie" in c["body"]:
        print(c.reply(".. doobidoo"))

Best of luck with your bot!

Sort:  

How do I run the bot

This bot is hilarious! If "Boobie" print ".. doobidoo" Hahahah. Thanks for posting!

Damn , Ive been putting off learning how to code...maybe this is the motivation I need.

but where to start?

Where everyone starts. You write program that prints "Hello World!" on the screen.

https://www.khanacademy.org/

I have a CentOS 7 cpanel server that i host my clients sites. Is there any way (tutorial) to setup python localy to an account that i will create and then piston e.t.c whatever is required to make a python bot there. I tried but had no success. Thanks

Doesnt work: "RuntimeError: autoconf error
" after i run "python3 setup.py install --user"

And if i run "piston" then i get
bash: piston: command not found

Thanks man!
Worth much more than that ruby stuff I've tried before.
I'd prefere plain "C" but python should do as well.

ran into a few issues.
piston is obsolete now. febinkk piston-lib fork works quite nice.
Have to replace "STEEMIT_BLOCK_INTERVAL" by "STEEM_BLOCK_INTERVAL" in blockcahin.py
Suse-Leap installed python3.4 missing the import name "RemoteDisconnected" so I've installed python3.6 in virtual envirnoment which works fine.

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 65128.68
ETH 3442.23
USDT 1.00
SBD 2.52