create account

RE: [Dev-Blog #9] Upcoming Projects (Steem Swift Wrapper, Steemit Transaction Bot) + Week Plans by gokulnk

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

Viewing a response to: @moonrise/dev-blog-9-upcoming-projects-steem-swift-wrapper-steemit-transaction-bot-week-plans

· @gokulnk ·
I think your work on "Steem Swift Wrapper" will be most helpful to the community. Let us hope it will kickstart ios app based on Steem blockchain. 

BTW do you know how to get the comment perm link when you use 

`steem.broadcast.comment` method? From the output I am not able to get the permlink. I assumed that it would be available in the output of the method but there seems to be nothing there other than transaction id and related data.
properties (22)
authorgokulnk
permlinkre-moonrise-dev-blog-9-upcoming-projects-steem-swift-wrapper-steemit-transaction-bot-week-plans-20180305t185958459z
categorydevelopment
json_metadata{"tags":["development"],"app":"steemit/0.1"}
created2018-03-05 19:00:00
last_update2018-03-05 19:00:00
depth1
children2
last_payout2018-03-12 19:00:00
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_length442
author_reputation17,871,219,215,380
root_title"[Dev-Blog #9] Upcoming Projects (Steem Swift Wrapper, Steemit Transaction Bot) + Week Plans"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,444,248
net_rshares0
@sambillingham ·
$0.03
Hey @gokulnk  you pass the permlink parameter  to the ```steem.broadcast.comment``` function so you should already have access to it. For example here I am using the string function to store the permlink for the comment before broadcasting, if you needed you could pass it to the callback function too.

```
 let permlink = randomString();
 steem.broadcast.comment(
            author_wif,
            '',
            tag,
            author_name,
            permlink,
            '',
            comment,
            { tags: ['tag1'], app: 'helloworld/v.0.0.1' },
            function(err, result) {
              console.log(err, result);
            }
          );
```
```
function randomString() {
    let string = ''
    let allowedChars = "abcdefghijklmnopqrstuvwxyz0123456789";
    for (var i = 0; i < 32; i++){
        string += allowedChars.charAt(Math.floor(Math.random() * allowedChars.length));
    }
    return string + '-post';
}
```
👍  
properties (23)
authorsambillingham
permlinkre-gokulnk-re-moonrise-dev-blog-9-upcoming-projects-steem-swift-wrapper-steemit-transaction-bot-week-plans-20180305t210913948z
categorydevelopment
json_metadata{"tags":["development"],"users":["gokulnk"],"app":"steemit/0.1"}
created2018-03-05 21:09:12
last_update2018-03-05 21:09:12
depth2
children1
last_payout2018-03-12 21:09:12
cashout_time1969-12-31 23:59:59
total_payout_value0.021 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length948
author_reputation34,876,406,478,004
root_title"[Dev-Blog #9] Upcoming Projects (Steem Swift Wrapper, Steemit Transaction Bot) + Week Plans"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,464,184
net_rshares6,934,083,831
author_curate_reward""
vote details (1)
@gokulnk ·
$0.06
@sambillingham you are a saviour. My bad, I took a break from coding and forgot that I was passing this parameter myself :P I am using the below for permlink and I can use the same for upvote as well.

`var commentPermlink = steem.formatter.commentPermlink(parentAuthor, parentPermlink);`
👍  
properties (23)
authorgokulnk
permlinkre-sambillingham-re-gokulnk-re-moonrise-dev-blog-9-upcoming-projects-steem-swift-wrapper-steemit-transaction-bot-week-plans-20180306t145431305z
categorydevelopment
json_metadata{"tags":["development"],"users":["sambillingham"],"app":"steemit/0.1"}
created2018-03-06 14:54:33
last_update2018-03-06 14:54:33
depth3
children0
last_payout2018-03-13 14:54:33
cashout_time1969-12-31 23:59:59
total_payout_value0.048 HBD
curator_payout_value0.014 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length288
author_reputation17,871,219,215,380
root_title"[Dev-Blog #9] Upcoming Projects (Steem Swift Wrapper, Steemit Transaction Bot) + Week Plans"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,643,642
net_rshares16,325,678,528
author_curate_reward""
vote details (1)