Here is how you can programmatically cast your 30 witness votes on Steemit

avatar
(Edited)



This simple tutorial allows you to cast your Steemit witness votes account in a bunch of seconds, simply pasting a script in any browser.

NOTES:

  • This script requires that you enter your account's active key in the script in order to make it work.

It is completely safe though! If you have a basic understanding of Javascript you can verify yourself that your keys are not sent or stored anywhere besides Steem API!

STEP 1


Open your favorite browser on ANY site (I strongly recommend using Brave browser for its security and speed!)
and open the DevTools (Ctrl + Shift + J on Linux/Windows and Cmd + Opt + J on Mac)

STEP 2


Open a new tab, navigate to https://cdn.jsdelivr.net/npm/steem/dist/steem.min.js (SteemJs)
and copy and paste (Ctrl + A and Ctrl + C) the steem.js minified code into the Browser Console (DevTools) that you opened in the first tab.

STEP 3


Copy and paste my script below in the Console.

Note: before pressing enter change the myAccount and privateActiveKey with your credentials and feel free to change the list of witnesses that you want to vote for.
The list of witnesses in my code snippet was taken from @enforcer64.
If you want to follow some else's choice of witnesses visit their steemd page (eg. @theycalledmedan -> https://steemd.com/@theycallmedan) and copy their list from the "@theycallmedan votes for:" section.

var myAccount = 'gaottantacinque';
var privateActiveKey = '5Kb************************************3Nrd';

var witnessesToVote =  [
  'anyx',
  'ats-witness',
  'ausbitbank',
  'blocktrades',
  'bobinson',
  'c-squared',
  'c0ff33a',
  'coingecko',
  'dragosroua',
  'drakos',
  'emrebeyler',
  'good-karma',
  'gtg',
  'guiltyparties',
  'isnochys',
  'klye',
  'netuoso',
  'nextgencrypto',
  'ocd-witness',
  'patrice',
  'pharesim',
  'qurator',
  'r0nd0n',
  'roelandp',
  'someguy123',
  'steempeak',
  'steempress',
  'stem.witness',
   // 'themarkymark', // sorry, not a fan
  'yabapmatt',
];

// Remove all votes
var getMyAccountWitnessVotes = () => new Promise((resolve) => {
  console.log(`Checking witnes votes for ${myAccount}`);
  steem.api.getAccounts([myAccount], (err, result) => {
    if (err) {
      throw new Error(`Unable to get witness votes for ${myAccount}`);
    }
    resolve(result[0].witness_votes);
  });
});

// Value: [1 = vote, 0 = unvote]
var voteForWitness = (witnessName, value) => new Promise((resolve) => {
  console.log(`${value ? 'Voting' : 'Unvoting'} for ${witnessName}..`);
  steem.broadcast.accountWitnessVote(
    privateActiveKey, myAccount, witnessName, value,
    (err, result) => {
      if (err) {
        throw new Error(`Unable to vote for ${witnessName}`);
      }
      resolve(result);
    });
});

var replaceAllWitnessVotes = async () => {
  const myOldVotesArr = await getMyAccountWitnessVotes();
  for (let id = 0; id < myOldVotesArr.length; id++) {
    const currentWitness = myOldVotesArr[id];
    const res = await voteForWitness(currentWitness, 0);
    console.log(currentWitness, 'unvoted.', res);
  }
  for (let id = 0; id < witnessesToVote.length; id++) {
    const newWitness = witnessesToVote[id];
    const res = await voteForWitness(newWitness, 1);
    console.log(newWitness, 'voted.', res);
  }
  console.log('All done.');
}
replaceAllWitnessVotes();

You prefer clicking buttons around? Visit https://steemitwallet.com/~witnesses.

No matter what you are more comfortable with, please cast your witness votes as this is a critical time for Steemit!



0
0
0.000
7 comments
avatar

According to the Bible, Are you the true church?

Watch the Video below to know the Answer...

(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)


Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to Thank you, our beloved friend.
Check our Discord Chat
Join our Official Community: https://steemit.com/created/hive-182074

0
0
0.000
avatar

[jokemode:on]
yaaay, so we've got 7 out of 50 characters of his key, bruteforce tiiiiiiimeeeeeeeeeee (~‾▿‾)~
[/jokemode:off]

Nice work. I was too lazy clicking through the witnesses and was trying to mash it up as well, you beat me to it :)

0
0
0.000
avatar

I changed those 7 too lol. But I must admit, it was late, I was tired and initially submitted the post with my full key in it. Luckily the UI warmed me so it did not go through. If it didn’t (other UIs don’t have this check in place) my bot @keys-defender would have notified me and saved my funds ;=}

Yep this script is useful if you have multiple accounts. Glad someone will use it =}

0
0
0.000