<center>![witnesses.png](https://ipfs.busy.org/ipfs/QmTML5cYW1Eae6F2voENHjWCzFmrddruzsbSXotoccUmBi) <sup>Screenshot: https://steemd.com/witnesses</sup></center> Inspired by @gadrian's recent post ["Had a look at my approved witness list [...]"](https://staging.busy.org/@gadrian/had-a-look-at-my-approved-witness-list-and-a-list-of-tools-for-new-and-not-so-new-steemians) I decided to take a look to my own witness votes. One aspect here was: do I vote for inactive witnesses. While there's nothing wrong with voting for (permanently) inactive witnesses, it just doesn't benefit anybody. There are probably a couple of tools already out there to get the same information, but I'll take the occasion to show how this can be done with [beem](https://github.com/holgern/beem)/python: Steps involved: * get a list of all witnesses an account votes for * get the witness details of those * check if they have set the 'disabled' signing key STM1111111111111111111111111111111114T1Anm * check for how long they haven't been scheduled a block Code: ```python import sys from beem import Steem from beem.blockchain import Blockchain from beem.account import Account from beem.witness import GetWitnesses from prettytable import PrettyTable from datetime import timedelta, datetime s = Steem(use_condenser=True) a = Account(sys.argv, steem_instance=s) pt = PrettyTable(['Witness', 'inactive since']) head = Blockchain(mode='head', steem_instance=s).get_current_block_num() for w in GetWitnesses(a['witness_votes'], steem_instance=s): if w.is_active is True: inactive_date = "active" else: inactive = timedelta(seconds=(head - w['last_aslot']) * 3) inactive_date = (datetime.utcnow() - inactive).date() pt.add_row([w['owner'], inactive_date]) print(pt) ``` Remarks: * The list of voted witnesses is only available via the condenser API (for whatever reason?!) - this is why it needs a dedicated `Steem()` instance. * The last scheduled block is given as a block number. In order to get the time since then, I take the difference in blocks to the current head block and calculate the time with the Steem block time (3s). Save the snippet above as a .py file and run it with python (assuming beem is installed): ``` python [filename].py [your_account] ``` Here's the result for me <center> ![inactive_witnesses.png](https://ipfs.busy.org/ipfs/QmVA9umkBS8DEG8M9ZyZm9R4rdTT995BJ7Aq6yTrQuQENE) </center> There are two candidates who shut down their witnesses and were last scheduled around half a year ago. I'll probably unvote those. I realize I have quite a couple of free slots - not that my stake moves the ranks, but time to have a look for new witnesses to vote. Every vote counts. Feel free to leave a comment if you want to have your witness votes checked, I can run the same script for you.