I had to find a new way to do this when the API changed last night, so after I spent some tme working on it, I thought I'd post what I found. It was tested in the bash shell on Ubuntu 16.04 under both Oracle's VirtualBox and the app from the Windows Store. If you want to query your voting power from a linux command line, this is one way:
ACCT="<your_steemit_id>"
API=https://api.steemit.com
curl -s ${API} --data "{\"jsonrpc\": \"2.0\", \"method\": \"call\", \"params\": [\"database_api\", \"get_accounts\", [[\"$ACCT\"]]], \"id\": 3}" \
| sed 's/.*voting_power\"://g' \
| awk -F, '{printf "%2.2f\n", $1/100}'
You can just copy/paste that whole block and plug-in your account if you want, but here is how it works:
ACCT=<your_steemit_account>
Tells it the account you want to search for.
API=https://api.steemit.com
Sets the steemd node that you're going to query.
As you're probably aware, the "\" character at the end of each line in the next command sequence is a continuation indicator. It's just there for readability. (The other ones are inside of quotes, so they don't get interpreted by the shell.) The "|" (pipe) character takes the output of one command and sends it as input to the next. Here is a break down of what the individual components of the pipeline do. First:
curl -s ${API} --data "{\"jsonrpc\": \"2.0\", \"method\": \"call\", \"params\": [\"database_api\", \"get_accounts\", [[\"$ACCT\"]]], \"id\": 3}"
Uses "curl" to connect to the API web server and excecute the "get_accounts" database API call, which is described here. The jsonrpc syntax came from @theoretical, here. Using my ID, with keys stripped out (for no good reason) its output looks like this:
$ curl -s ${API} --data "{\"jsonrpc\": \"2.0\", \"method\": \"call\", \"params\": [\"database_api\", \"get_accounts\", [[\"$ACCT\"]]], \"id\": 3}"
{"result":[{"id":26206,"name":"remlaps","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[["-----",1]]},"active":{"weight_threshold":1,"account_auths":[],"key_auths":[["-----",1]]},"posting":{"weight_threshold":1,"account_auths":[["busy.app",1],["utopian.app",1]],"key_auths":[["-----",1]]},"memo_key":"-----","json_metadata":"{\"profile\":{\"profile_image\":\"https:\/\/media.licdn.com\/mpr\/mpr\/shrinknp_400_400\/p\/2\/000\/028\/0bf\/04cf437.jpg\",\"name\":\"Steve Palmer\",\"location\":\"West Chester, PA, USA\",\"cover_image\":\"https:\/\/s12.postimg.org\/g2hf7i2fx\/clouds2010.jpg\",\"about\":\"Information Technology Professional; Co-founder of @classical-music\"}}","proxy":"","last_owner_update":"2016-07-20T15:35:45","last_account_update":"2017-11-17T03:54:12","created":"2016-07-17T15:35:42","mined":false,"owner_challenged":false,"active_challenged":false,"last_owner_proved":"1970-01-01T00:00:00","last_active_proved":"1970-01-01T00:00:00","recovery_account":"steem","last_account_recovery":"1970-01-01T00:00:00","reset_account":"null","comment_count":0,"lifetime_vote_count":0,"post_count":926,"can_vote":true,"voting_power":5841,"last_vote_time":"2018-01-07T17:14:18","balance":"0.000 STEEM","savings_balance":"0.000 STEEM","sbd_balance":"0.000 SBD","sbd_seconds":"0","sbd_seconds_last_update":"2018-01-07T17:06:15","sbd_last_interest_payment":"2018-01-07T05:34:36","savings_sbd_balance":"0.000 SBD","savings_sbd_seconds":"0","savings_sbd_seconds_last_update":"1970-01-01T00:00:00","savings_sbd_last_interest_payment":"1970-01-01T00:00:00","savings_withdraw_requests":0,"reward_sbd_balance":"0.000 SBD","reward_steem_balance":"0.000 STEEM","reward_vesting_balance":"43.018649 VESTS","reward_vesting_steem":"0.021 STEEM","vesting_shares":"2616968.599382 VESTS","delegated_vesting_shares":"1241104.666666 VESTS","received_vesting_shares":"0.000000 VESTS","vesting_withdraw_rate":"0.000000 VESTS","next_vesting_withdrawal":"1969-12-31T23:59:59","withdrawn":0,"to_withdraw":0,"withdraw_routes":0,"curation_rewards":98593,"posting_rewards":2892248,"proxied_vsf_votes":["4981834850357",0,0,0],"witnesses_voted_for":27,"average_bandwidth":"70980937925","lifetime_bandwidth":"4773268000000","last_bandwidth_update":"2018-01-07T17:21:00","average_market_bandwidth":"41326209051","lifetime_market_bandwidth":"1140150000000","last_market_bandwidth_update":"2018-01-07T00:54:48","last_post":"2018-01-05T06:24:42","last_root_post":"2018-01-03T00:25:18","vesting_balance":"0.000 STEEM","reputation":"23787535588477","transfer_history":[],"market_history":[],"post_history":[],"vote_history":[],"other_history":[],"witness_votes":["abit","anyx","arcange","ats-witness","bitcoiner","blocktrades","busy.witness","chainsquad.com","curie","dragosroua","furion","good-karma","gtg","jesta","joseph","liondani","lukestokes.mhth","neoxian","patrice","pfunk","pharesim","roadscape","roelandp","sc-steemit","smooth.witness","someguy123","utopian-io"],"tags_usage":[],"guest_bloggers":[]}],"id":3}
Not very readable to a human, which is why we have the rest of the pipeline. The first step of the pipeline:
sed 's/.*voting_power\"://g'
takes that as input and blanks out everything up to and including the string voting_power:", which leaves us with this (again, using my ID):
curl -s ${API} --data "{\"jsonrpc\": \"2.0\", \"method\": \"call\", \"params\": [\"database_api\", \"get_accounts\", [[\"$ACCT\"]]], \"id\": 3}" | sed 's/.*voting_power//g'
5841,"last_vote_time":"2018-01-07T17:14:18","balance":"0.000 STEEM","savings_balance":"0.000 STEEM","sbd_balance":"0.000 SBD","sbd_seconds":"0","sbd_seconds_last_update":"2018-01-07T17:06:15","sbd_last_interest_payment":"2018-01-07T05:34:36","savings_sbd_balance":"0.000 SBD","savings_sbd_seconds":"0","savings_sbd_seconds_last_update":"1970-01-01T00:00:00","savings_sbd_last_interest_payment":"1970-01-01T00:00:00","savings_withdraw_requests":0,"reward_sbd_balance":"0.000 SBD","reward_steem_balance":"0.000 STEEM","reward_vesting_balance":"43.018649 VESTS","reward_vesting_steem":"0.021 STEEM","vesting_shares":"2616968.599382 VESTS","delegated_vesting_shares":"1241104.666666 VESTS","received_vesting_shares":"0.000000 VESTS","vesting_withdraw_rate":"0.000000 VESTS","next_vesting_withdrawal":"1969-12-31T23:59:59","withdrawn":0,"to_withdraw":0,"withdraw_routes":0,"curation_rewards":98593,"posting_rewards":2892248,"proxied_vsf_votes":["4981834850357",0,0,0],"witnesses_voted_for":27,"average_bandwidth":"70980937925","lifetime_bandwidth":"4773268000000","last_bandwidth_update":"2018-01-07T17:21:00","average_market_bandwidth":"41326209051","lifetime_market_bandwidth":"1140150000000","last_market_bandwidth_update":"2018-01-07T00:54:48","last_post":"2018-01-05T06:24:42","last_root_post":"2018-01-03T00:25:18","vesting_balance":"0.000 STEEM","reputation":"23787535588477","transfer_history":[],"market_history":[],"post_history":[],"vote_history":[],"other_history":[],"witness_votes":["abit","anyx","arcange","ats-witness","bitcoiner","blocktrades","busy.witness","chainsquad.com","curie","dragosroua","furion","good-karma","gtg","jesta","joseph","liondani","lukestokes.mhth","neoxian","patrice","pfunk","pharesim","roadscape","roelandp","sc-steemit","smooth.witness","someguy123","utopian-io"],"tags_usage":[],"guest_bloggers":[]}],"id":3}
This is still not very readable, but now you can at least see my current voting percentage at the beginning of the line. Next:
awk -F, '{printf "%2.2f\n", $1/100}'
Gets rid of everything after the first comma and prints the result as a percentage.
$ curl -s ${API} --data "{\"jsonrpc\": \"2.0\", \"method\": \"call\", \"params\": [\"database_api\", \"get_accounts\", [[\"$ACCT\"]]], \"id\": 3}" \
> | sed 's/.*voting_power\"://g' \
> | awk -F, '{printf "%2.2f\n", $1/100}'
58.41
So that's it. I had a script that had been using cli_wallet to accomplish the same thing, but the version of cli_wallet that I had doesn't seem to want to work with the new API node, so this is what I came up with. Thought I'd pass it along, in case it might be useful to anyone else.
Hope that helps!