steem-js icon indicating copy to clipboard operation
steem-js copied to clipboard

How do I post content programmatically?

Open adriano-di-giovanni opened this issue 8 years ago • 5 comments

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

adriano-di-giovanni avatar Sep 09 '17 12:09 adriano-di-giovanni

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.

relativityboy avatar Sep 09 '17 17:09 relativityboy

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

bonustrack avatar Sep 11 '17 14:09 bonustrack

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.

nkgokul avatar Jan 23 '18 13:01 nkgokul

@bonustrack , can u give a hint , how i do add an image in post while posting using steemjs

potadibyo avatar Mar 19 '18 08:03 potadibyo

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.

bartosz546 avatar Mar 20 '18 16:03 bartosz546