How To Create Steem bots with JavaScript Development

in #steemiteducation6 years ago (edited)

main-qimg-f2f152154146fd4f3bde7e3e575d40cf.png

Creating Steemit Bot is easy thing to do with browsers like mozilar firefox and google chrome.
This bot will actually show you the amount of steem or SBD in your wallet and also those who are following you.
Its very easy to be done.

Follow the steps to have your own bot
So, lets start.⭐🔥🔥🔥

1: Let's start by creating a folder on your desktop of your computer.
NB: No phone can be used to perform this actions. I am saying this because , from tge above intro, i said we can do it with mozilar and chrome which are now having their andriod applications.

2: Open this folder and create a file called “index.html” without the quotes.

NB:__Make sure you turn off the option “Hide extensions for known file types “ by following the directions at otherwise your “index.html” file will actually be “index.html.txt” but the “.txt” will be hidden! This will prevent your bot from executing. This option can be found by following this (a. Click on windows icon defaultly at down left corner of the computer screen . b: type in the search bar {hidden} and click on the first option that pops up. C: Navigate to find {Hide extensions for unknown files and put it off}

3: You can create this file by right clicking then “New → Text Document” in the pop-up windows.
The “index.html” file will contain code for your first steemit bot. You will need to open this file with Notepad by right clicking then “Open with → Choose another app”.

4: Now scroll down and select “Notepad” and then click OK.

5: The code below is what you will need for your bot.

    <head>
        <script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
        <script>
            steem.api.getAccounts(['showboybeezy'], function(err, response){
                    console.log(err, response);
            });
        </script>
    </head>
    <body>
        Hello Steem!
    </body>
</html>

Highlight, copy, then paste this code into NotePad and then save it.

6: Now click the file and it should open in your default browser. If not, right click then “Open with → Google Chrome” and then click your browser .

7: Now that you have your bot opened in your web browser, you will need to open the developer tools by clicking the 3 circles on the top right of the page then clicking “More Tools → Developer Tools”. This will split the browser window into two panels.

8: Click the "consol " tab in the developers menu,
You will see the null → Array(1) text in the window. If not, refresh the page and it should be there. You can scroll through it to see all the data that is returned from the JavaScript call. Click the arrows on the left to open down a tree with all of the data returned. The code copied above contains my username “showboybeezy”, so replace it with you or anyone's screen name.

9: We are almost done, so let's get the data to display on the web page. Copy and paste this code in the consol area into the NotePad window for the “index.html” file, save it and then refresh your browser.

10: or copy the below code and paste it in the created folder only if you are using Mozilar

    <head>
        <script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
        <script>
            steem.api.getAccounts(['showboybeezy'], function(err, response){
                    //console.log(err, response);
                document.getElementById("name").innerHTML = response[0]['name'];
                document.getElementById("balance").innerHTML = response[0]['balance'];
                document.getElementById("created").innerHTML = response[0]['created'];
            });
        </script>
    </head>
    <body>
        Hello <span id="name">Steem</span>!
        <div>You have <span id="balance">0 Steem</span>.</div>
        <div>Your account was created on <span id="created">2000-01-01T00:00:00</span>.</div>
    </body>
</html>

11: You are good now, and this guide is just to get you started. Follow Me for more tutorials on building bots for steemit.

Thank you.
@showboybeezy

Read and adopted from. https://steemit.com/steemit/@money-dreamer/creating-first-steemit-bot

Sort:  

Awesome dude! i will try that tommorow.

This is just a copy/paste of this original post: https://steemit.com/steemit/@money-dreamer/creating-first-steemit-bot

Ok friend

He did make some improvements to the original and I released it under "The Unlicense" so this is OK from my perspective.

Yes
And i am sorry i didnt link the link

You can Edit your post to add the link, would be awesome! :)

It is Very easy.Thanks for it bro...
Bro It becomes more amazing if we can make it on android mobile please share that how we can make bot onandroi mobile.Keep it up

*Thank you

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.029
BTC 58000.61
ETH 3105.20
USDT 1.00
SBD 2.42