
Updated some codes on back-end of steemauto.com
By these changes, fanbase and upvoting comments should work fine.
You don't need to understand that codes.
Commits:
Number 1: Streaming blocks and detecting posts which are authored by fans. Then upvoting that posts.
Some codes:
...
...
// Upvoting Fanbase Followers
var fanupvote = function(author,permlink){
try{
var datee = new Date();
var secondss = datee.getTime()/1000;
con.query('SELECT `follower`,`weight`,`aftermin` FROM `fanbase` WHERE `fan` = "'+author+'" AND `enable`="1"', function (error, results, fields) {
for(i in results){
var follower = results[i].follower;
var voted = 0;
if(voted == 0){
var weight = results[i].weight;
var aftermin = results[i].aftermin;
var datee = new Date();
var secondss = datee.getTime()/1000;
var now = Math.floor(secondss);
if(aftermin > 0){
var time = parseInt(now+(aftermin*60));
con.query('INSERT INTO `upvotelater`(`voter`, `author`, `permlink`, `weight`, `time`,`trail_fan`) VALUES ("'+follower+'","'+author+'","'+permlink+'","'+weight+'","'+time+'","2")', function (error, results, fields) {
});
console.log('fan to delay');
}else{
upvote(follower,author,permlink,weight);
console.log('fan to up');
}
}
}
});
}
catch(e){
console.log('error in fan upvote.'+e);
}
}
...
...
Number 2: Checking users every 15 minutes and checking their reward balance. then claiming that rewards.
Some codes:
...
...
//broadcasting claim reward with adding to queue
//queue will prevent blockchain spamming
var delay3 = 0;
function broadcastclaim(username,sbd,vest){
delay3 = delay3 +1;
setTimeout(function(){
steem.broadcast.claimRewardBalance(wifkey,username,'0.000 STEEM',sbd,vest, function(err, result) {
if(err){
console.log('err in claim2.');
}else{
console.log('claim done.');
}
});
delay3 = delay3 -1;
},100*delay3);
return 1;
}
...
...
Number 3: Streaming blocks and detecting comments on configured users. Then upvoting configured commenters.
Some codes:
...
...
// Upvoting Comments Automatically //
var delay2 = 0;
function commentupvote(userr,commenter,permlink,parentpermlink){
try{
con.query('SELECT EXISTS(SELECT * FROM `commentupvote` WHERE `user` = "'+userr+'" AND `commenter`="'+commenter+'" AND `enable`="1" AND `todayvote`<2)', function (error, results, fields) {
for(i in results){
for(j in results[i]){
if(results[i][j] == 1){
con.query('SELECT EXISTS(SELECT * FROM `upvotedcomments` WHERE `user` = "'+commenter+'" AND `permlink`="'+parentpermlink+'")', function (error, results, fields) {
for(o in results){
for(p in results[o]){
if(results[o][p] == 0){
con.query('SELECT `weight`,`aftermin` FROM `commentupvote` WHERE `user` = "'+userr+'" AND `commenter`="'+commenter+'" AND `enable`="1" AND `todayvote`<2', async function (error, results, fields) {
for(k in results){
var weight = results[k].weight;
var aftermin = results[k].aftermin;
var datee = new Date();
var secondss = datee.getTime()/1000;
var now = Math.floor(secondss);
if(aftermin > 0){
var time = parseInt(now+(aftermin*60));
con.query('INSERT INTO `upvotelater`(`voter`, `author`, `permlink`, `weight`, `time`,`trail_fan`) VALUES ("'+userr+'","'+commenter+'","'+permlink+'","'+weight+'","'+time+'","3")', function (error, results, fields) {
});
con.query('UPDATE `commentupvote` SET `todayvote`=`todayvote`+1 WHERE `user` = "'+userr+'" AND `commenter`="'+commenter+'"', function (error, results, fields) {
});
con.query('INSERT INTO `upvotedcomments`(`user`, `permlink`,`time`) VALUES ("'+commenter+'","'+parentpermlink+'","'+now+'")', function (error, results, fields) {
});
console.log('comment to delay');
}else{
console.log('comment to upvote');
upvote(userr,commenter,permlink,weight);
con.query('INSERT INTO `upvotedcomments`(`user`, `permlink`,`time`) VALUES ("'+commenter+'","'+parentpermlink+'","'+now+'")', function (error, results, fields) {
});
con.query('UPDATE `commentupvote` SET `todayvote`=`todayvote`+1 WHERE `user` = "'+userr+'" AND `commenter`="'+commenter+'"', function (error, results, fields) {
});
}
}
});
}
}
}
});
}
}
}
});
}
catch(e){
console.log('error in comment upvote.');
}
}
...
...
More information about codes included as comments on each file.
What is Steemauto?
Steemauto comes with amazing features, Schedule post, Build a Fanbase, or leave a curation trail for users all around the world to follow.
Steemauto is open source, unlimited, secure and free app for steem users.
Regards,
Steem witness,
Mahdi Yari,
2018-01-30
Posted on Utopian.io - Rewarding Open Source Contributors
Excelent job! We need all this.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice work!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wow, i love this info. Thanks @mahdiyari. Keep us updated
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
this a good news for us also thanks for informing about this.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Awesome my brother @mahdiyari always tells us a lot. We learn from you always do not skimp on us information. I follow all that is new about you. Thank you
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulation my friend
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
can new user use it?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
yes. maybe some features.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
"You don't need to understand that codes." this information so important for me. Because i dont understand codes :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you sir for contributing a valuable information
It is most important for me
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wow you are doing great, so many recent updates - thank you for sharing and keep improving the steemit community with your development!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for the update @mahdiyari
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Fantastic information. Thanks :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks for informations
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Well done... I've signed up in steemauto few weeks ago, but actually starting using it since yesterday for the first time. I used the manual curation service which was very smooth and easy to you. But I wanted to ask you about the auto follow / follower service, is it off now?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @mahdiyari I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks info @mahdiyari
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for updating about something new always, keep posting!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
"You don't need to understand that codes."
Yeah I don't need to coz I know its great update :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It's really good the way you are giving a good message to the world,,,,
I love your post,,, thank you my dear friend for sharing with #Us,,,,,,, and very good job,,,keep it #Up,,,
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for the awesome post. I have followed, upvoted your post. Just follow me and upvote this comment for future upvote for your content.
Please 1 vote me..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Perfect
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congrats @mahdiyari
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
well done!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wow saya baru mengetahui hal ini , terimakasih @mahdiyari saya akan mengikuti selalu perkembangan terbaru dari postingan anda
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit