[Steem Curator] - MVP - Comments Curation

in #utopian-io6 years ago

Repository

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

Production URL:

https://steemcurator.com/
https://steem-curator.firebaseapp.com/

Commits

First commit with the mvp
Added comments for better readability
Updates to Readme #1 and #2

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

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

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

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

case BotActionTypes.RetrieveBotInformationSuccess: {
      return [
        ...state,
        ...action.payload
      ];
    }

This code updates the state with the retrieved list of objects for current bid.

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

<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

Sort:  
Loading...

Hey @mightypanda
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by mightyPanda from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 64999.89
ETH 3101.81
USDT 1.00
SBD 3.87