Skip to content

Instantly share code, notes, and snippets.

@emre emre/ Secret
Last active Apr 16, 2019

What would you like to do?
3rd party voting on dpoll
import json
import uuid
import requests
from steem import Steem
from steem.transactionbuilder import TransactionBuilder
from steembase import operations
# configuration
voter = "<voter_username>"
s = Steem(keys=["<private_key>"])
poll_author = "steemalliance"
poll_permlink = "steem-alliance-structure-proposal-election"
votes = [
'“DeCentraSteem” Submitted By @impactn',
ops = [
"author": voter,
"body": 'Voted for \n - %s' % votes[0],
"permlink": str(uuid.uuid4()),
"parent_permlink": poll_permlink,
"parent_author": poll_author,
"json_metadata": json.dumps({
"content_type": "poll_vote",
"votes": votes,
"tags": ["dpoll", ]
"title": "",
tb = TransactionBuilder()
tb.appendSigner(voter, "posting")
resp = s.broadcast_transaction_synchronous(tb)
# trigger dpoll to register the vote it's own database
r = requests.get("", params={
"block_num": resp["block_num"],
"trx_id": resp["id"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.