You are viewing a single comment's thread from:

RE: TUTORIAL - Reblog Contest - Building With Steem-js #10

in #utopian-io7 years ago

Thank you for the contribution. It has been approved.

Cool tutorial once again! I can't believe steem-js doesn't have a function similar to the get_reblogged_by() function in steem-python! Maybe you can call the Steemit API directly instead of iterating over all the blocks (not sure how this works and I could be completely wrong)?

You can contact us on Discord.
[utopian-moderator]

Sort:  

Thanks Amos.

I didn't think to check what steem-python does. Interesting to hear it has a built in API call, that must mean there is a correlating endpoint. I'm going to take a closer look tonight and see if I can make the call directly or add a method to steem-js. I need to learn more about the steemd nodes and how the libraries interact myself. It's an intresting learning exerise to iterate the blocks but pretty unrealistic to do it every time you want the data.

The actual steem-js api has got the getRebloggedBy() . I corrected this on my comment to @money-dreamer after he gave us that nice little brain teaser, which maybe should not have been so much of a tease if I just RTFM but they make it difficult to find the right manual since this is hosted by steemconnect

https://v2.steemconnect.com/docs/steemjs
https://v2.steemconnect.com/docs/steemjs#api/get_reblogged_by

can include using the cdn link
https://cdn.steemjs.com/lib/latest/steem.min.js
and it will work with the nice little default code as in examples

function reblogged(){
    steem.api.getRebloggedBy("sambillingham","tutorial-reblog-contest-building-with-steem-js-10", function(err, result) {
        console.log(err, result);
      });
}
reblogged();

Nice work! You're right it's a little difficult to know where to look for the correct information. I had not seen the Steemconnect hosted docs before. I was sure I searched the Github repo for 'reblogged' but perhaps not as I just went back and easily found it in the methods.js file although it easy to get thrown off as the method names are not in camel case.

Thanks for posting this, as interesting as the tutorial is getRebloggedBy() is the way to go!

Coin Marketplace

STEEM 0.25
TRX 0.27
JST 0.041
BTC 97752.40
ETH 3582.53
SBD 1.59