API/Tool Update: Steem Mutual Witness Report

in #witness-category4 years ago

A while ago, I implemented this tool: https://steemyy.com/mutual-witness/ which allows you to see who you vote, who also vote you back, and who hasn't.

The API was based on SteemSQL but fortunately, this can be easily replaced using SteemJS.

The following SteemJS search the proxy chain:

async function getWitnessProxy(id) {
    return new Promise((resolve, reject) => {
        steem.api.getAccounts([id], async function(err, result) {
            if (err || (!result) || (!result[0]) || (result.length === 0)) {
                resolve("");
            }
            if (result && result[0] && result[0].proxy) {
                const data = await getWitnessProxy(result[0].proxy);
                resolve(result[0].proxy + " " + data);
            }  
            resolve("");
        });
    });
} 

The API: https://steemyy.com/api/steemit/witness_voters/?cached&id=STEEM_ID will return the following JSON object.

{
  votes: [],   // who you vote
  both: [],    // and who have voted you back
  not: [],      // and who haven't voted you back
  proxy_chain: []    // the proxy chain separated by space.
}

You can invoke the API via GET or POST by passing the parameter id.

The GUI tool that calls the API looks something like this: https://steemyy.com/mutual-witness/?id=justyy

image.png

image.png


I hope this helps!

Steem On!~

If you like my work, please consider voting for me, thanks!
https://steemit.com/~witnesses type in justyy and click VOTE



Alternatively, you could proxy to me if you are too lazy to vote!

Also: you can vote me at the tool I made: https://steemyy.com/witness-voting/?witness=justyy

Visit me at: https://steemyy.com

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 54414.30
ETH 2295.54
USDT 1.00
SBD 2.30