[Steem Curator] - Oracle-D Posts Curation

Words
385
Reading
2 min
Listen
Play
8y

Repository:

https://github.com/mightypanda-x/steem-curator

Production URL:

https://steemcurator.com/

Previous Posts

https://busy.org/@mightypanda/steem-curator-mvp-comments-curation
https://busy.org/@mightypanda/steem-curator-easies-curation-and-tech-debt
https://busy.org/@mightypanda/steem-curator-sorting-feature-and-utopian-posts
https://busy.org/@mightypanda/steem-curator---user-preference-settings
https://busy.org/@mightypanda/steem-curator---utopian-moderator-comment-curation

New Feature and associated pull request

Oracle D is a new project that brings investments to the steem platform and has a list of approved writers who write about these projects. These writers are rewarded with an upvote from oracle-d account. Rewards are usually in the range of $25 to $35. Since this is a lesser known whale, it provides for a great opportunity to make big curation rewards.

Pull Request: https://github.com/mightypanda-x/steem-curator/commit/8b9b3804ba63c50fb60343c9724b5b3586f44017

Under the hood

src/app/oracle-d-posts/oracle-d-posts.component.ts

Maintaining a list of oracle-d reviewers and bloggers. This is a hard coded list as there is no way to find out approved oracle-d bloggers. This list is compiled from the oracle-d account voting behavior.
image.png

Dispatching actions to retrieve last 5 posts for the users. Posts for each author is retrieved individually so the whole page is not held up as we are working though the author list. This also provides for a good failsafe incase 1 or more steem apis fail to get a response.

We are also retrieving site preferences so we can show which posts user has already voted on and we can take them to their desired site.
image.png

src/app/post/reducers/post.reducers.ts

Retrieve action retrieves the posts for the author and updates the state with the newly retrieved list.
Clear action clears the state object.
image.png

This selector checks the retrieved posts for various conditions like:

  • They have beneficiary set as oracle-d.pay
  • They have not been voted by oracle-d already.
  • The post hasn't paid out
  • It has been at least 15 min since the post creation.
    image.png

src/app/post/services/post.service.ts

This code makes a call to steem api to get last 5 posts from the user. Once response is received, it promisifies the response.
image.png

This code allows us to retrieve posts for multiple authors at the same time. This combines multiple promise calls using Promise.all method. Essentially this code is future proof when we would like to use similar functionality for other parts of the application.
image.png

Once all the data is received, we feed this data to a datastore which is used to populate angular material table. This table allows for sorting of some essential columns for easier curation.

Feedback?

If you have any feedback or would like to add some new features, please let me know in the comments below.

Github: https://github.com/mightypanda-x

[Steem Curator] - Oracle-D Posts Curation | Ecency