You are viewing a single comment's thread from:
RE: 10 SBD SteemJS Programming Question
Thanks. I sent the 10 SBD. I still would like the code to read directly from the blockchain as you stated in option a. Do you know of any code examples that do that? I'm only going back 7 days and it will only be run periodically (say, once per day) so that shouldn't be too bad. Or, I could just start a listener and collect new transactions as they come in right when the contest post is created. Thanks!
Sorry if I'm late to the party. I am doing the inverse of what you're looking for.
https://github.com/r351574nc3/steem-bot-examples/blob/0f2867fd3f80c0c30f0271c05071d5c41363408a/auto-reply-steem-bot/app/helpers/bot/reply.js#L118
My example uses
getDiscussionsByBlogto retrieve blog entries. I only wanted my unique entries, but the results were returning resteems.I ended up writing this to filter out resteems
https://github.com/r351574nc3/steem-bot-examples/blob/0f2867fd3f80c0c30f0271c05071d5c41363408a/auto-reply-steem-bot/app/helpers/bot/reply.js#L41
If
results.id == 0, that means it's a resteem. I used the inverted condition to filter those out. Hope this helps. You can run this periodically.Thank you for the reward @money-dreamer, I had not done this before and enjoyed investigating and finding a solution. I've not seen any examples of Option A code it's been on my to "make tutorial" list but I've not got around to it just yet. If I would be helpful to you I will do that next and try to get it online asap?
Yes. That would be great. I want to learn how to read all the data directly from each block - maybe getMostRecentBlock and getBlockNumber.
Also, if there is some way to listen to new transactions being broadcast to the blockchain from within Node, that would be useful.
yes It's possible with those functions, have been super busy. Aiming to get a demo/tutorial online tomorrow.
For anyone interested that tutorial is now here -https://steemit.com/utopian-io/@sambillingham/tutorial-reblog-contest-building-with-steem-js-10