How to get steemit account details with the help of Nodejs.

in GEMS5 years ago

Hello Peoples!

Today we are going to run a piece of script to get any steemit account details. This is just a practice to understand steemit blockchain and javascript. To run our script we will need an IDE. We can use an online compiler to run our script or we can use the installed compilers like visual studio but I am going to use an online compiler repl.it(Already discussed in previous posts).So without wasting time lets start the tutorial

  • Visit Repl.it and create a new repl.

image.png

  • Select javascript as your language and click create.

image.png

  • Click on the pakages and install the steemitjs package.

image.png

  • Search for steemit and select the first one.

image.png

  • Open github and then open the steemit API.

image.png

  • Scroll down and find Browser.

image.png

  • Copy the highlighted code. Ignore the rest these are for browser as we are working with nodejs so we don't need that.

  • Open the repl tab again and write.

let steem=require("steem")

image.png

  • And then paste the code copied from steem API. The script should look like this.

image.png

  • Now change the Ned and Dan with the username you want details. (For example, I am replacing it with my own user name).

image.png

  • Run the script.

image.png

  • And you will get the details int his pattern,

image.png

  • It is showing my wallet data as well like how much STEEM SBD I have.

image.png

Script

let steem = require('steem');
steem.api.getAccounts(['pakgamer'], function(err, result) {
    console.log(err, result);
});

This much is enough for today. In the next posts i may discuss how to comment with the help of coding.
So see you in the next post take care till that.