Making a Steem Bot

for those who want to learn how code bots.

So first you must have the follow pre-reqs:

  1. Python knowledge
  2. Some programming experience.

So how to you create a posting bot with these simple lines of code:


from steem import Steem
from steem.post import Post

steemAccount = Steem(keys=['insert keys'])
posted = steemAccount.commit.post("title of the post", "the body, were your writing goes", "nameofaccount", tags=postDict['tags'], self_vote=True)


So with the above simple set of lines u can post a new post, pretty cool hey. So lets break down the code a little:



from steem import Steem
from steem.post import Post


The first 2 lines import the modules u need to login in as a Steem account and then Post using the Post module.

**
steemAccount = Steem(keys=['insert keys'])
**

This line lets u put in your steam keys, typically you just wan to use your posting key so that if a hacker gets into your code u only has to worry about him posting and nothing else. If you need the program to do money transactions and or voting then you entering in more keys like suck:


steemAccount = Steem(keys=['posting key', 'voting key','transfer money key'])


Pretty simple and straight forward.

Ok the next step is posting, which is covered by this line:


posted = steemAccount.commit.post("title of the post", "the body, were your writing goes", "nameofaccount", tags=postDict['tags'], self_vote=True)


so you have to access your steemAccount then access the commit method and post method. Then u need to pass in the title, body and name of the account you are posting with and finally pass in tags as an array. This is where you thing your post should go and be search via index.

So I hope you enjoyed this short tutorial.

#please vote for me as a witness if you like my technical expertise and I really want to make a difference when it comes to the steam community.

https://steemit.com/~witnesses

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center