Creating Bots with steem.js - Tutorial Series

Repository

https://github.com/steemit/steem-js
https://github.com/code-with-sam/steem-js-bot-tutorials/

bots-with-steem-js.jpg

Creating Bots with steem.js

This set of tutorials is an updated version of a series I worked on at the start of 2018. Today I’m kicking off code-with-sam - my new initiative to bring back more tutorials to the blockchain. I’ve gone through the previous set of tutorials checked everything still works with the current api.steemit.com implementation.

These tutorials are probably the most useful content I've added to the chain. With the tutorials buried in old feeds and broken links from the previous Utopian.io version I wanted to bring the series back to life.

There is now a single store on Github for all of the tutorial code. Each tutorial is also now available on Codepen.io so can be quickly modified and played with.

Outline

These tutorials introduces the steem.js Javascript library. Capable of interacting with the STEEM blockchain via code. Steem.js is one of the first libraries developers of all skills levels encounter when researching the available resources.

These tutorials aim to introduce basic ideas of interfacing with the blockchain via code. Streaming transactions, inspecting transactions for a specific type (‘vote’, ‘comment’, ‘transfer’), submitting new transactions. Each tutorial aims to learn concepts with a real use-case by building a small project.

Difficulty

Beginner - Intermediate
This is a fairly friendly set of tutorials for those who have experimented with web development in any way in the past. If you are a complete beginner you should still be able to follow along. If you get stuck at any point leave a comment.

Requirements

  • A plain text editor (I use VS Code )
  • Your private posting key - This is found in your wallet on the permissions tab on steemit.com, click ‘show private key’ (remember to keep this safe - treat is as your password).
  • Some tutorials use Node.js
  • Enthusiasm for the STEEM Blockchain 🙌

#1 Auto Upvote Bot - Upvote posts from a set of users

| Tutorial
| Github - Code
| Codepen Example

#2 Curation Bot - Copy the upvotes of a selected user
| Tutorial
| Github - Code
| Codepen Example

#3 Auto follow bot - Copy who a selected user follows
| Tutorial
| Github - Code
| Codepen Example

#4 Paid upvote bot - Upvote a user in proportion to receiving SBD
| Tutorial
| Github - Code
| Codepen Example

#5 @ Mention Notifier bot - Receive an email when @mentioned
| Tutorial
| Github - Code
| Codepen Example

formcarry.com is now a viable alternative to using formspree as the orginal tutorial mentions. You can create a free form at Formcarry and set you email to be notified. After creating a form you’ll see 🗝 Your form endpoint which you can use as the url in the Ajax function.

#6 Auto Reward Claimer bot - Check and claim rewards
| Tutorial
| Github - Code
| Codepen Example

#7 Bots In The Background - Using Node.js and scheduling code
| Tutorial
| Github - Code
| Repl.it Example

#8 Stats Responder - Reply with message when @mentioned
| Tutorial
| Github - Code
| CodePen Example

#9 Contest Bot - Storing JSON & checking hastags
| Tutorial
| Github - Code
| *Example - this project requires file system access and therefore is not easily able to live on Codepen or repl :(

#10 ReBlogged List - Checking all transactions for specific data
| Tutorial
| Github - Code
| Codepen - Example
| Codepen - Optimised alternative

#11 Zeit Now - Running your Steem.js Bot 24/7 on a Server
| Tutorial
| Github - Code

While this tutorial still works and is a great starter to node.js, Zeit Now it is not recommend for production code. As of November 8th 2018 Zeit moved to version 2 and the platform has changed significantly. You can specifically set version 1 while it is still supported.

{
    "env": {
        "BOT_POSTING_KEY": "@bot-11-posting-key"
    },
    "version": 1
}

#12 User Wallet History with Steem.js
| Tutorial
| Github
| Codepen

I hope you find this set of tutorials useful. I will be going over each of the tutorials to create a new version that uses DSteem instead of steem.js. Over the past year DSteem has grown in popularity to become the defacto Javascript library for interacting with the blockchain. DSteem outperforms steem.js in benchmarks, is feature rich and maintained to a higher standard than steem.js.

If you feel any of these tutorials need further updating you can submit a PR on Github or comment here.

If you have questions or ideas on anything related to these tutorials or steem.js please reach out.

Github

@codewithsam is my new page for tutorials
Github - code-with-sam x sambillingham
https://github.com/code-with-sam/steem-js-bot-tutorials/

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