Share your love famous quote in steemit comment

Google+ Pinterest LinkedIn Tumblr +
Showing 1 of 1

Hi All,..
Do you lave Quote?
I will share the node.js code that can create steemit comment on the tag of your choice whit randome famous quote.

The original code is belong to @klye : https://steemit.com/steemdev/@klye/vooby-steem-bot-v0-0-1-open-source-nodejs-introduceyourself-upvoting-script, i’m just put the randome quote comment.

//Rendome Quote 
var comments = ['`TB Joshua`: `If you don’t have a vision, you can never be focused in a direction.`', '`TB Joshua` : `Every day, God has something to say to you. Even when He seems to be quiet, God is still saying something.`', '`TB Joshua` : `Where there is unconditional love, the wound of one is the wound of all.`'];   
//console.log(item);
// Steemit Private Posting Key
var wifkey = '';
// Steemit username
var votey = "";
// Enter the Tag you want to upvote new posts in
var targettag = "";  
// May want to modify this (10000 = 100% vote)
var weight = 10000;
// No need to modify these variables
var steem = require('steem');
var totalvote = 0;
var metadatascan;
var json_metadata;
var op;

steem.api.streamBlockNumber(function (err1, newestblock) {
    console.log("Scanning Block #" + newestblock + " For New #" + targettag + " Posts - Posts Voted: " + totalvote);
});
var process_post = function (op) {
    if (op["author"] != "") {
      // console.log(targettag + " Post Has Been Detected!");
        steem.broadcast.vote(
            wifkey,
            votey,
            op["author"],
            op["permlink"],
            weight,
            function (downerr, result) {
                if (downerr) {
                    var error = JSON.stringify(downerr);
                    if (error.toLowerCase().indexOf("You have already voted\n") >= 0) {
                        console.log("Oops! a post it already voted on!");
                    }
                }
                if (result) {
                    totalvote++;
                    console.log("Successfully voted #" + targettag + " post!");
                    //-------------------comment
                var time3 = new Date() /1;
                var item = comments[(Math.random()*comments.length)|0];
                var permlink1 = 're-'+op["author"]+'-'+op["permlink"]+'-'+time3+'z';
                var jsonMetadata = '{"tags":["steem"],"app":"comment.js/0.01"}';
                steem.broadcast.comment(wifkey, op["author"], op["permlink"], votey, permlink1, '', +item , jsonMetadata, function(err, result) {});
                                //-------------------------         
        }
            }
        );
    }
};

steem.api.streamOperations(function (err2, blockops) {
    var opType = blockops[0];
    var op = blockops[1];
    if (op["json_metadata"] != undefined) {
        metadatascan = op["json_metadata"];
        if (metadatascan != '') {
            var tags = JSON.parse(metadatascan);
            var actualtags = tags["tags"];
            if (actualtags != undefined) {
                var tagtag = String(actualtags);
                if (op["parent_author"] === '') {
                    if (tagtag.toLowerCase().indexOf(targettag) >= 0) {
                        process_post(op);
                    }
                }
            }
        }
    }
});
Showing 1 of 1
Share.

About Author

Leave A Reply