create account

RE: TUTORIAL - Beginner friendly - Build your first steem bot in Javascript - 30minutes by gokulnk

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @sambillingham/tutorial-beginner-friendly-build-your-first-steem-bot-in-javascript-30minutes

· @gokulnk ·
For this particular version of js file can you post the code for post comments?

<code>
  var parentAuthor = 'author1';
  var parentPermlink = 'permlink;
  var commentPermlink = steem.formatter.commentPermlink(parentAuthor, parentPermlink);
  var postTitle = WELCOME_COMMENT_TITLE;
  var postBody = WELCOME_COMMENT_BODY;


  steem.broadcast.comment(ACCOUNT_WIF, parentAuthor, parentPermlink, ACCOUNT_NAME,
        commentPermlink, postTitle, postBody,
         {"tags":["tag1"]},
         function(err, result) {
           console.log(result);
         });
</code>

The above code doesn't seem to work and the version specific changes are not documented well enough I think.
properties (22)
authorgokulnk
permlinkre-sambillingham-tutorial-beginner-friendly-build-your-first-steem-bot-in-javascript-30minutes-20180120t222616121z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-01-20 22:26:18
last_update2018-01-20 22:26:18
depth1
children6
last_payout2018-01-27 22:26:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length675
author_reputation17,871,219,215,380
root_title"TUTORIAL - Beginner friendly - Build your first steem bot in Javascript - 30minutes "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id30,964,951
net_rshares0
@sambillingham ·
Hey @gokulnk, can you be a little more clear so I can help you out? 

- Where is this code from? (it's not this tutorial)
- What do you mean by 'code doesn't work' - what error messages are you getting, what is happening?
- What are you wanting to do?
- Can you post your full code somewhere?
properties (22)
authorsambillingham
permlinkre-gokulnk-re-sambillingham-tutorial-beginner-friendly-build-your-first-steem-bot-in-javascript-30minutes-20180121t220727720z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["gokulnk"],"app":"steemit/0.1"}
created2018-01-21 22:07:24
last_update2018-01-21 22:07:24
depth2
children5
last_payout2018-01-28 22:07:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length292
author_reputation34,876,406,478,004
root_title"TUTORIAL - Beginner friendly - Build your first steem bot in Javascript - 30minutes "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id31,210,096
net_rshares0
@gokulnk ·
The code you have given in your sample works perfectly. 

I was just trying to build on it to add comments to a post. 

I keep getting the following error. 

``` "Expected version 128, instead got 149" ```

Please let me know if you were able to post comments through the code.
properties (22)
authorgokulnk
permlinkre-sambillingham-re-gokulnk-re-sambillingham-tutorial-beginner-friendly-build-your-first-steem-bot-in-javascript-30minutes-20180122t145010549z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-01-22 14:50:18
last_update2018-01-22 14:50:18
depth3
children4
last_payout2018-01-29 14:50:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length277
author_reputation17,871,219,215,380
root_title"TUTORIAL - Beginner friendly - Build your first steem bot in Javascript - 30minutes "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id31,401,800
net_rshares0
@sambillingham ·
okay thanks for clarifying, it's 100% possible to send comments through code.

See this broadcast function - https://github.com/code-with-sam/steem-versary-bot/blob/master/bot.js#L183

notice the operations array on line 150 - https://github.com/code-with-sam/steem-versary-bot/blob/master/bot.js#L150
properties (22)
authorsambillingham
permlinkre-gokulnk-re-sambillingham-re-gokulnk-re-sambillingham-tutorial-beginner-friendly-build-your-first-steem-bot-in-javascript-30minutes-20180122t203222385z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://github.com/code-with-sam/steem-versary-bot/blob/master/bot.js#L183","https://github.com/code-with-sam/steem-versary-bot/blob/master/bot.js#L150"],"app":"steemit/0.1"}
created2018-01-22 20:32:21
last_update2018-01-22 20:32:21
depth4
children3
last_payout2018-01-29 20:32:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length301
author_reputation34,876,406,478,004
root_title"TUTORIAL - Beginner friendly - Build your first steem bot in Javascript - 30minutes "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id31,471,381
net_rshares0