hmm ... i'm not the python guy but so far when dealing with steem(it) it seems pretty much inevitable ... i havent found any php lib and if its not for parsing w. condenser python seems about the only option other than 'manually' signing ( = lol )
->
https://steemit.com/steem/@xeroc/steem-transaction-signing-in-a-nutshell
(in a nutshell as the dude so eloquently states)
i dont know what OS tickles your fancy but im prone to l00nix (mint usually, regardless of the front desktop, that depends on the hardware, i find cinnamon the most pleasing but not really fit for my celeron-machines ...)
so
(not sure if you need this, im sure you didnt ask for it but if you wanna do steem it might help - i find the documentation severely lacking and even the how-to installit on linux didnt work for me as is , so ):
installsteem.sh0
#!/bin/bash
#######################################
sudo apt install -y git
git clone https://github.com/steemit/steem-python.git
sudo apt install -y python3-dev
cd steem-python
sudo apt install -y python3-setuptools
sudo apt install -y libssl-dev
sudo python3 setup.py install
did it last time
then you can use steempy from the cli
steempy
or
steempy --help
...the usual , for all wallet stuff and voting (following too i think and some other stuff , and
pythoncat.py (more like a copy paste adapted from some thing i found somewhere)
from steem import Steem
from steem.transactionbuilder import TransactionBuilder
from steembase import operations
import time, random, os
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):
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)
print ("Submitted post")
except Exception as error:
print(repr(error))
return permlink
def run():
author = 'ubakdhfsdkljhfsdklsti'
upvote_bot = 'minnowbooster'
amount = 0.05
post = [line.rstrip('\n') for line in open('postbodytext')]
title = post[0]
tags = post[1]
author = post[2]
body = '\n'.join(post[3:])
permlink = submit_post(title, tags, body, author)
if __name__ == '__main__':
run()
if found that somewhere else, just mark out the buy an upvote bit and put the postbody in a flatfile (however you want that, typed or pre-generated) and that's good to go and someone pointed me into the direction of custom json this week (which is actually where the real power resides ... and all the bru-ha on communities and smt's is probably nothing more than a 'for the masses' interface to do what was there all along .. musing and steemmonsters , steemstem, drugwars and probably a zound more have been doing that a long time
customcenter.py
from steem import Steem
from steem.transactionbuilder import TransactionBuilder
from steembase import operations
s = Steem(nodes=["https://api.steemit.com"],
keys=["INSERTTHATPOSTINGKEYHERE"])
account = "INSERTYOURACCOUNTNAMEHERE"
apythonvariable = "i dont really know howapythonvariable works and what it looks like"
#post = [line.rstrip('\n') for line in open('ascithing')]
ops = [
operations.CustomJson(**{
"from": account,
"id": "dndchar",
"json": [ 'my char',
{
"name": "Von Trappiƫl",
"race": "high elf",
"alignment": "chaotic-good",
"STATS": "STR:12,DEX:18,CON:10,INT:16:WIS:14,CHA:16",
"ETCETERA": "i suppose you can use more brackets im not the json expert",
"ETC2": "and stuff",
"args": apythonvariable
}
],
"required_auths": [],
"required_posting_auths": ["INSERTYOURACCOUNTNAMEHERE"],
}),
]
tb = TransactionBuilder()
tb.appendOps(ops)
tb.appendSigner(account, "posting")
tb.sign()
tb.broadcast()
(to read a file into var you just unmark the #post bit , im sure you know plenty to read the code) i really dont know jack about python lol i never needed it and its only by necessity for lack of php-signing lib which i cant find anywhere (or unix lib for that matter so the heavy layer of python seems unavoidable)
should both work if you imported an account keys into steempy with
steempy importaccount (i think)
the flatfile for posting has title at line 0, tags at line 1 etc ... but since you know base python (probably more than me you can read that
im starting to assume like the elder devs do here lol
anyway ... maybe it helps with the hobby ...
since i just though of it ... i just thought ...
if you got any working scripts that do anything steemrelated sure don't mind you leave them in a reply to the only post i have on my feed here (but just as good if you dont, its just fyi)
second one has the posting key in it 'naked which i dont really like but its not an actual disaster either ... i hope i didnt leave any of mine in ;-
:: funny lulz like custom ascii logos :
http://localhost/api_tyr/dc_v1.php
euhm yagh make that
https://alleycat.be/api_tyr/dc_v1.php (stands for datacenter @gmdatacenter, not disconnection heh)
v2 is testing the ways to pack all @goldmanmorgan wallets into one chunk but offline when im not working on it (its just some bedroom leftover pc, not meant for hi traffic)
or you could build steemmonsters, i guess, if you had UltiMatt drive & money :D
i always find an example to mess with is worth 20 pages of theory and seven courses by some elite dude who thinks everyone speaks school-kid ... but im just a hobbyist ofcourse ;-)))))
right ... im gonna try and remember what i was doing ttyl cu around
RE: Teaching myself Python Day 3