I need some help with SteemJS. I'm developing some bots for Steem, but I'm not professional developer and I need some help.
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 :)
For number 3 (where is number 2?), replacing the
streamTransactions
function with this, should fix the issues, by making Node.js ignore the errors. It also works when multiple operations are in one transaction:Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you very much :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Those small typos are always the funniest.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
keep going on you will be succed
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Sneaky Ninja Attack! You have just been defended with a 24.14% upvote!
I was summoned by @fbslo. I have done their bidding and now I will vanish...
woosh
A portion of the proceeds from your bid was used in support of youarehope and tarc.
Abuse Policy
Rules
How to use Sneaky Ninja
How it works
Victim of grumpycat?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit