create account

A Python script to unvote top20 witnesses by emrebeyler

View this thread on: hive.blogpeakd.comecency.com
· @emrebeyler ·
$12.60
A Python script to unvote top20 witnesses
```
from lighthive.client import Client
from lighthive.datastructures import Operation

def unvote_top_20(account, active_key):
    c = Client(keys=[active_key])
    top20_witnesses = set(
        [w["owner"] for w in c.get_witnesses_by_vote("", 20)])
    witness_votes = set(c.get_accounts([account])[0]["witness_votes"])
    intersection = top20_witnesses.intersection(witness_votes)
    print("These witnesses will be unvoted:", ", ".join(intersection))

    ops = []
    for witness in intersection:
        op = Operation('account_witness_vote', {
            'account': account,
            'witness': witness,
            'approve': False,
        })
        ops.append(op)

    c.broadcast(ops)


if __name__ == '__main__':
    unvote_top_20("your_account_name", "<active_key>")
```
***
The result:
***
<center><img src="https://i.imgur.com/7p4dHZ2.png"></center>
***
Not that there is something wrong with anybody in the top20 list at the moment, however, the amount of difference [MV] in votes between top20 and the rest is very big.

Of course, I've some favorite people on that list, so in case they have a danger to lose their spot, I'll be voting for them, again. But until then, it's what it's. I'll be using my spare votes for promising backup witnesses instead. 

If you agree with this approach, you can set me your [witness voting proxy](https://hivesigner.com/sign/account-witness-proxy?proxy=emrebeyler&approve=1), so that you don't have to deal with this yourself.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 53 others
properties (23)
authoremrebeyler
permlinka-python-script-to-unvote-top20-witnesses
categorywitness-category
json_metadata{"tags":["witness-category","witness","lighthive"],"image":["https://i.imgur.com/7p4dHZ2.png"],"links":["https://hivesigner.com/sign/account-witness-proxy?proxy=emrebeyler&approve=1"],"app":"hiveblog/0.1","format":"markdown"}
created2020-03-31 21:45:30
last_update2020-03-31 21:45:30
depth0
children2
last_payout2020-04-07 21:45:30
cashout_time1969-12-31 23:59:59
total_payout_value6.579 HBD
curator_payout_value6.018 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,486
author_reputation448,535,049,068,622
root_title"A Python script to unvote top20 witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,658,134
net_rshares36,153,591,439,988
author_curate_reward""
vote details (117)
@howo ·
:(

more seriously, I don't think it should be a blind unvote all, just unvote the witnesses you voted to protect the chain.
properties (22)
authorhowo
permlinkre-emrebeyler-q87x82
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"peakd/2020.03.14"}
created2020-04-03 15:19:15
last_update2020-04-03 15:19:15
depth1
children0
last_payout2020-04-10 15:19:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length124
author_reputation515,737,941,459,006
root_title"A Python script to unvote top20 witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,693,804
net_rshares0
@manniman ·
Funny :D
properties (22)
authormanniman
permlinkre-emrebeyler-q82wz3
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"peakd/2020.03.14"}
created2020-03-31 22:25:54
last_update2020-03-31 22:25:54
depth1
children0
last_payout2020-04-07 22:25:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8
author_reputation77,790,724,868,389
root_title"A Python script to unvote top20 witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id96,658,513
net_rshares0