Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What about commenting post? #2

Open
ghost opened this issue Apr 10, 2018 · 0 comments
Open

What about commenting post? #2

ghost opened this issue Apr 10, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 10, 2018

Well, I love that tutorial since it is so simple and easy to work with. I only struggling how to make that same user comment on the post. Even if that would be the same user?So far I did create code like this:

<html>
<head><title>User blog</title>
</head>
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
   
<script language="javascript">


function postComment()
{
  
	steem.broadcast.comment(
  
	  document.getElementById('postingKey').value, //posting wif
	  document.getElementById('username').value,  // author, leave blank for new post
	  'steemtest', //firsttag
	  document.getElementById('username').value, // username
	  'name-of-my-test-article-post', // permlink			
	  '', //posting title
	  document.getElementById('article').value,, //posting article text
	  // json metadata (addtional tags, app name)
	  { tags: ['secoundtag'], app: 'steemtest'},
	  
	  function(err, result) {
		  if(err)
			alert('Failure!' + err);
		  else
			alert('success!');
		 }
	);
}


</script>

  <body> 
  
	<br>
	<br>
	
    Username <input id="username" value="username" type="text"><br>
    Password <input id="postingKey" type="password" value="" size="65"><br>
    Title <input id="title" type="text" value="this is just a php test post"><br>
    Article text <textarea id="article"></textarea><br>
	<input id="postIt" type="button" value="Post It!" onclick="postComment()">
	
	<br>
	<br>
  </body>
</html>

By looking at steem-js it should work but, it gives me ERCerror Unknown Key. How to fix that problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants