What Is the Lastest Account Created on Steemit at Any Time?

in technology •  7 years ago 

I wrote a NodeJS script that shows the latest account created on Steemit. I think the ID number of the latest account shows the number of accounts created so far (I may be wrong though). Anyway, this script runs under NodeJS, so you have to have node on your system.

First, install the steem package:

    npm install steem

Then save the following script in a file named file.js:

    const steem = require("steem");
    steem.config.set("websocket", "wss://steemd.privex.io");

    Promise.resolve("steem")
    .then(steem_account_name => new Promise((resolve, reject) => {
            steem.api.getAccountHistory(steem_account_name, -1, 10, function (err, result) {
                if (err) {
                    reject(err);
                } else {
                    for (let i = result.length; --i >= 0; ) {
                        let item = result[i];
                        if (item[1].op[0] === "account_create_with_delegation") {
                            resolve(item[1].op[1].new_account_name);
                            break;
                        }
                    }
                }
            });
        }))
    .then(latest_account_name => new Promise((resolve, reject) => {
            steem.api.getAccounts([latest_account_name], function (err, result) {
                if (err) {
                    reject(err);
                } else {
                    resolve([latest_account_name, result[0].id]);
                }
            });
        }))
    .then(data => console.log(data))
    .then(() => process.exit(0));

Since this script was just a quick program, it contains a few assumptions. For example, it assumes that the account was created by the account steem and it was created with delegation (that's true for all accounts created by the Steemit website). Also, we assume that the account creation transaction is in the last 10 transactions of the account history. If not, you can increase the limit.

Now, run the file with the following command:

    node file.js

Here is the output I got a moment ago:

[ 'andymoonpie', 430585 ]

I guess this means that we have currently about 430,585 accounts on Steemit.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Amazing idea...

Facebook has over 2 billion active users and they receive 0$ daily.
Steemit has only 450000 users but they receive 50000$ daily.

I can't stop laughing when I am writing this.

Excellent code! Appreciated!

ooo you had share great information thank you for sharing it

great to know that

this code is nice;

really great work done.

Really nice script.

This wonderful post has received a bellyrub 5.89 % upvote from @bellyrub.