I would like to add the comment options and the beneficiary using this simple javascript function in my own dapp. I can broadcast the article to the steem blockchain already but I don't know how to add the beneficiary for the article.
I took the code from an old tutorial and it is the simplest and working easy one I found so far, but I can't figure out how to add the beneficiary, and I'm sure that is just an extra line of code.
<head>
<title>steem-js posting example</title>
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
<script language="JavaScript">
function postArticle()
{
steem.broadcast.comment(
document.getElementById('postingKey').value, // posting wif
'', // author, leave blank for new post
'dapptest', // first tag
document.getElementById('username').value, // username
'name-of-my-test-article-post', // permlink
document.getElementById('title').value, // Title
document.getElementById('article').value, // Body of post
// json metadata (additional tags, app name, etc)
{ tags: ['secondtag'], app: 'dapp-test!' },
function (err, result) {
if (err)
alert('Failure! ' + err);
else
alert('Success!');
}
);
}