SteemJS Help Needed --> 4 SBD + 4 SBD Rewards

fbslo(71)
Published in
#steemjs
Words
127
Reading
1 min
Listen
Play
8y

I need some help with SteemJS. I'm developing some bots for Steem, but I'm not professional developer and I need some help.

alt


1) 3 SBD Reward

I would like to get all posts with some tag that was created in last 24 hours. How?


32) 3 SBD Reward

I have this code:
It works fine, only when block contains no transactions it crashed. How can I check if block contains transactions and skip empty blocks?

//get steem.js -> npm install steem --save
var steem = require('steem');

//get transactions from head block
        steem.api.streamTransactions('head', function(err, result) {
          let txType = result.operations[0][0]
          let txData = result.operations[0][1]
          let includesVotes = checkBlockForVote(txType,txData)
          if (includesVotes) {
            console.log('POST FOUND: ', txData)
          }
        });
        function checkBlockForVote(txType,txData) {
          //check if voter is fbslo. If voter = fbslo, your account will vote same post.
          if( txData.voter == 'fbslo') {
            console.log('POST: ', txData)
            upvote(txData)
          }
        }
        function upvote(txData){
          console.log('Upvoting...',  )
          //You account name
          var voter = 'your-account';
          //Your account private posting key
          var wif = 'private-posting-key';
          var author = txData.author
          var permlink = txData.permlink
          //Change weight 100% vote = 10000; if you use txData.weight it will upvote with same voting weight as "followed" voter.
          var weight = txData.weight
          //Broadcast vote to blockchain
          steem.broadcast.vote(wif,voter,author,permlink,weight,console.log)
}

How to get reward?

Answer to my questions in comment bellow. You will also get 100% upvote :)


fbslo@fbslo


27496184_2012467288996553_1171355060_n.png
(Click on the button)

alt

(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)


Please read my Witness Thread and support me by voting fbslo@fbslo for witness.

SteemJS Help Needed --> 4 SBD + 4 SBD Rewards | Ecency