import time, random, os, json, sys
def buy_upvote(author,upvote_bot, amount, permlink):
transfers =[{
'from': author,
'to': upvote_bot,
'amount': '{0:.3f} SBD'.format(amount),
'memo': 'https://steemit.com/@{}/{}'.format(author, permlink)
}]
tb = TransactionBuilder()
operation = [operations.Transfer(**x) for x in transfers]
tb.appendOps(operation)
tb.appendSigner(author, 'active')
tb.sign()
try:
tx = tb.broadcast()
print ("Buying vote succes")
except Exception as error:
print(repr(error))
def submit_post(title, tags, body, author, upvote_weight):
steemPostingKey = os.environ.get('steemPostingKey')
steem = Steem(wif=steemPostingKey)
permlink_title = ''.join(e for e in title if e.isalnum()).lower()
permlink = "{}-%s%s".format(permlink_title) % (time.strftime("%Y%m%d%H%M%S"), random.randrange(0,9999,1))
try:
steem.post(title, body, author, permlink, None, None, None, None, tags, None, False)
steem.vote('@{}/{}'.format(author,permlink), int(upvote_weight), author)
print ("Submitted post")
except Exception as error:
print(repr(error))
return permlink
def run():
author = 'sttest2'
upvote_bot = 'minnowbooster'
amount = 0.05
filename = sys.argv[-1]
lines = open(filename).readlines()
lines = [l.replace("\n", "") for l in lines]
title, tags, upvote_weight, body = (
lines[0],
lines[1],
lines[2],
"\n".join(lines[3:])
)
permlink = submit_post(
title, tags, body, author, upvote_weight)
#buy_upvote(author, upvote_bot, amount, permlink)
if name == 'main':
run()
Congratulations @sttest2! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
You got a First Vote
Award for the number of posts published
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit