Updated some codes on back-end of steemauto.com
By these changes, curation trail should work fine. You don't need to understand that codes.
Commits:
Number 1: Streaming blocks and upvoting curation trail.
Some codes:
...
...
var users=[];//fanbase
var users1=[];//trailers
var users2=[];//commentupvote
var server = https://private_server; //upvoting server
con.query('SELECT `user` FROM `trailers` WHERE `followers`>0', function (error, results, fields) { //Selecting Trailers
for(i in results){
users1.push(results[i].user);
}
});
// Updating Users List Every 10 Minutes
setInterval(function(){
try{
con.query('SELECT `user` FROM `trailers` WHERE `followers`>0', function (error, results, fields) {
var busers=[];
for(i in results){
busers.push(results[i].user);
}
users1 = busers;
});
}
catch(e){
console.log('error in updating users'+e);
}
},600000);
...
...
Number 2: Checking upvote queue and upvoting after x minutes.
Some codes:
...
...
//streaming block numbers
steem.api.streamBlockNumber(function (err1, newestblock) {
console.log(newestblock);
});
// Upvote function - included 0 seconds delay!
var delay = 0;
function upvote(voter,author,permlink,weight,type){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
if(this.responseText == 1){
console.log('up done');
}else if(this.responseText == 0){
console.log('err in up.');
}
}
};
xmlhttp.open("GET", server+'/?wif='+wifkey+'&voter='+voter+'&author='+author+'&permlink='+permlink+'&weight='+weight , true);
xmlhttp.send();
return 1;
}
...
...
Number 3: Upvote server which is running on a private node server.
Some codes:
...
...
if(wif && voter && author && permlink && weight){
steem.api.getContentAsync(author, permlink, function(erz, rez) { //checking if post already upvoted or not
if(!erz && rez){
var voted = 0;
for(j in rez['active_votes']){
if(rez['active_votes'][j].voter == voter){
voted = 1;
break;
}
}
if(voted == 0){
steem.broadcast.vote(wif,voter,author,permlink,weight,function(downerr, result){ //broadcasting upvote
if(!downerr && result){
res.end('1');
}else{
res.end('0');
}
});
}else{
res.end('0');
}
}else{
res.end('0');
}
});
}
...
...
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-29
Posted on Utopian.io - Rewarding Open Source Contributors
steemauto is amazing development and thanks for staying us updated regarding steemauto.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice work and information. This aids in bettering the steem blockchain and community...
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
Thanks for information
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Awesome information to move this community to a greater height .....
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
good info..I like your every post..
God bless you and wishes your long life....
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I dont really get what is it..? heh.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Auto upvote, sort of both that auto comment?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I can't understand. can you please explain more?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
is the program created for steemit?
is it the same as the auto comment program?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I don't know about auto comment program,
steemauto is for steem users.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I see there are some like that. they coment user at random.
so I think whether the program you created is the same.
but I do not know either
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Really cool site I like your additions of the curation trail - havent seen any other site do something like that! Really cool and creative ideas you got cant wait to see what else you can come up with ! @mahdiyari
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
If it is working perfectly the automatic vote and trail of healing is a genius thank you for creating this tool for the Community Seemit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This is the first time I heard Steemauto.But make sure to try it :)
It seems nice :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
dear @mahdiyari your good post...Thanks for information....i love your all post.....thank you so much for sharing.....♠……
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thank you so much... dear @mahdiyari...
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
thank you for this information
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great infomation....
Long live steemit and all steemians
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great to see you are constantly improving SteemAuto. 1UP will start soon.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for the contribution. It has been approved.
Great tool, good post details.
Please update that github README with more information. At least the steemit posts about it if you're not insprired.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I will update soon.
Thanks.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for the information, i'll try on shortly.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I will try to use it
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations my friend
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thank for information.. Congratulations
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
God bless you for this
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Should try it.
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
I dont really get what is it..? heh.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit