how to make a post
Hello Great Api! I was wondering how to make post from it like calling steem.broadcast.comment for which I need posting key which I can get from keys I guess after login?
Expected behavior
none
Actual behavior
none
no error. just finding out api usages
How to reproduce
Environment information
Same problem here. Some more detailed examples would be nice.
If you read the documentation, you will see:
steem.broadcast.comment(wif, parentAuthor, parentPermlink, author, permlink, title, body, jsonMetadata, function(err, result) {
console.log(err, result);
});
https://github.com/steemit/steem-js/blob/master/doc/README.md#comment
If you want a post, than parentAuthor is an empty string and parentPermlink is your first tag. You might want to check out any post's jsonMetadata on steemd to see how to do that part.
The doc also explains the login at the top of the page.
problem was didnt know how to get wif , figured out return steem.auth.toWif(uname, pwd, 'posting');
but still steem.broadcast.comment call succeeds but the post dont show up on steemit site ...happened so many times ..any idea?
You can just simply store your private posting key as string and use that. What you're doing now is storing your master key and make a call to get your posting key. I don't see why it is necessary unless you want to do transfers or other action requiring your master key somewhere else i the code.
Do you have any logging? You should receive a response (result or error) after broadcast.
Working for me.
var permlink = new Date().toISOString().replace(/[^a-zA-Z0-9]+/g, '').toLowerCase(); steem.broadcast.comment( 'private posting key', '', // Leave parent author empty 'test', // Main tag 'xenetics', // Author permlink + '-post', // Permlink 'This is just a test!', // Title 'Nothing to see here', // Body { tags: ['test'], app: 'steemjs/examples' }, // Json Metadata function(err, result) { console.log(err, result); } );
I wrote an article about it here.
Thanks @neander-squirrel .
how to do self upvote option steem.broadcast.comment ?
can i write permalink anything instead of 'test' ???? @lmiller1990 @neander-squirrel everytime i do permlink any thing instead of test , steem throws RPC error