How do I post content programmatically?
Maybe this is not the best place to ask such a question but I couldn't find any official one. So, feel free to redirect me ;)
How do I post content programmatically? I mean, is there any automatic way to publish an article on my blog?
Thanks, Adriano
I'm newer to steemit, but that would be something you might post on steemit itself. You could add a couple tags like "how to" and "steem" ( some common tags can be found @ /tags ). You could also hit up more explicit Q/A sites like quora.
P.S. "programatically" is a smelly word to devs; avoid.
To publish a content on the blockchain you always need a posting key at the moment of posting for generate the signature, you can't generate a signature long time before the moment of posting. The key used to sign can be the author posting key or a key of an authorised account of the author. For example my account authorise @streamian and @busy.app to post on my behalf https://api.steemjs.com/getAccounts?names[]=fabien this way
Taking an example from steem-versary code.
steem.broadcast.comment(ACCOUNT_WIF, parentAuthor, parentPermlink, ACCOUNT_NAME, commentPermlink, postTitle, postBody, JSON.stringify({ tags: 'steem-versary', app: 'steem-versary' }), function(err, result) { console.log("Comment function called"); console.log(result); console.log(err); });
where ACCOUNT_WIF is the posting key.
@bonustrack , can u give a hint , how i do add an image in post while posting using steemjs
I can suppose you've got to add pure html code in your post text, steem blockchain handle only pure text content, all formatting and interpratations are being done on frontend side.