[Steem Curator] - MVP - Comments Curation

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@mightypanda·
0.000 HBD
[Steem Curator] - MVP - Comments Curation
#### Repository
https://github.com/mightypanda-x/steem-curator

#### Production URL:
https://steemcurator.com/
https://steem-curator.firebaseapp.com/

#### Commits
[First commit with the mvp](https://github.com/mightypanda-x/steem-curator/commit/07adf9eda16f4c98e9974848c005598666b1e684)
[Added comments for better readability](https://github.com/mightypanda-x/steem-curator/commit/f49ce680e09b1b75412f136b51f99826b98205b7)
Updates to Readme [#1](https://github.com/mightypanda-x/steem-curator/commit/d75a0f28badbd7397a13d2fdb9ffde6602327284) and [#2](https://github.com/mightypanda-x/steem-curator/commit/2c1a4127b459770d9fe6d5fd536eab1a8027488c)

#### About steemcurator.com
Steem Curator is an effort to help the community with my knowledge of technology and steem economy. The goal of this project will always be to maximize your curation earnings by scanning through various bot activities to find best content to up-vote before major votes fall in so you earn curation reward for every vote that you cast.

#### Tech Stack
- Angular 6
- Ngrx
- RxJs
- Steem APIs
- TypeScript
- ES6
- Firebase

#### Whats done so far?
#
**Comments Curation**
This module looks through the current bids of 16 bots which support comment up-voting and displays the result for easy curation. I also added two links, one for steemit.com and other for busy.org. If you use busy.org, you can set voting % so you can cast more votes without depleting your voting power a lot. Even a small up-vote before the bigger votes gets you a decent share of curation pie.

#### Technical details
#
**comment-curation.component.ts**
```js
dispatchCommentActions = () => {
    _.forEach(this.commentBotList, (botName) => {
      this.store.dispatch(new BotActions.RetrieveBotInformation(botName));
    });
  }
```
This method iterates over a list of bot names that support comment up-voting and dispatches events.
#
**bot.effects.ts**
```js
getUserProfile = this.actions.pipe(
    ofType(BotActionTypes.RetrieveBotInformation),
    flatMap((action: RetrieveBotInformation) => this.botService.retrieveCurrentVotes(action.payload)
    .pipe(
      catchError(error => this.botService.handleError(error)),
      map((bidInfo: any) => new RetrieveBotInformationSuccess(bidInfo.current_round))
    ))
  );
```
This code will catch the action and call the service to get current bids for that bot.
#
**bid.model.ts**
```js
export interface BidModel {
  amount: number;
  currency: string;
  sender: string;
  author: string;
  permlink: string;
  url: string;
}
```
This is the modal of the bid. It helps with the type information.
#
**bot.reducer.ts**
```js
case BotActionTypes.RetrieveBotInformationSuccess: {
      return [
        ...state,
        ...action.payload
      ];
    }
```
This code updates the state with the retrieved list of objects for current bid.
#
```js
export const getCommentBids = (bidList: BidModel[]) => {
  const commentList = _.map(bidList, (list) => {
    if (list.url.indexOf('#') >= 0) {
      return list;
    }
  });
  return _.without(commentList, undefined);
};
```
This is a selector which filters all the post urls to find only comments.
#
**comment-curation.component.html**

```html
<tr *ngFor="let bid of bidsList$ | async; let i = index">
      <th scope="row">{{i + 1}}</th>
      <td>@{{bid.sender}}</td>
      <td>{{bid.permlink}}</td>
      <td>{{bid.amount}} {{bid.currency}}</td>
      <td>
        <a class="btn btn-outline-primary" [href]="'https://busy.org'+bid.url" target="_blank">Busy <i class="fas fa-external-link-alt"></i></a>
        <a class="btn btn-primary btn_steemit" [href]="'https://steemit.com'+bid.url" target="_blank">Steemit <i class="fas fa-external-link-alt"></i></a>
      </td>
    </tr>
```
This is the display logic. async pipe extracts the response from the returned observable and ngFor iterates over it to create rows of all the bids.

#### Roadmap
- Comments Curation module
- Post Curation module
- SteemConnect integration for voting from within the app
- Potential curation rewards calculation
------------------
Github: https://github.com/mightypanda-x
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,