Steemit API Voting Tutorial
Hey Steemians In this post i going to assume that you have a basic understanding of Javascript and you are here to get familiar with how the Steem API works and what you can do with it.
You can either use steem API from your Machine or Online.In this tutorial i am going to highlight the online version because it might be easier for people to follow that.
npm install steem --save
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
Now you should have everything configured and you should be able to use the API calls.
We will use the broadcast vote function with the following parameters.
steem.broadcastVote(privatepostingkey,usernameofvoter,'Usernamevotee','permanent link of the post',vote Percentage,callbackfunction())
Don't worry if you are confused by Permanent link.Here is a screenshot highlighting what it is.
Finally here is an example to help you out.
var username = 'ajkapss';
var privPostingWif ='yourprivatepostingkey'
steem.broadcast.vote(privPostingWif, username, 'ajkapss', 'c5umhlzr', 10000, function(err, result) {
console.log(err, result);
});
This is how your code should look like if you are using JsFiddle.
This is soooo Russian and Chinese at the same time for me dude! Let me head back in my oldtimer-cave haha
Nice tutorial, man :)
wonderful tutorial. thanks for making this tutorial
Thanks for sharing this on the platform😊
Great one my friend
Congratulations! This post has been upvoted from the communal account, @minnowsupport, by jsonkidd from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.
If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.