Link to PR here
Solves issues:
Bug Fixes
- Leaderboard sorting incorrectly
The leaderboard had a bug where it was sorting users alphabetically bya.username > b.usernameand this evaluates to a boolean. The sort function needs a number-1, 0, 1and therefore didn't sort correctly. Instead I simply let the algorithm sort by first posts, then votes.
- Not error handling broadcast issues correctly
Made these async functions with try/catch blocks to cover any exceptions.
New Features
Added the ability to post. Simply submit a valid Post object which is defined as:
export class Post {
// STEEM Blockchain
author: string;
permlink: string;
created: string;
title: string;
body: string;
votes: number;
jsonMetadata: JsonMetadata;
// SQL
did_comment: boolean;
did_vote: boolean;
}
It ignores the author variable and uses the STEEM_USERNAME environment variable with the STEEM_PASSWORD environment variable. This basically finishes up the "Broadcast" file as you can now post, comment, and vote. Posting can be thought of as simply commenting on a null object.
Now Playing
Check out the #nowplaying community and bot in action here
Posted on Utopian.io - Rewarding Open Source Contributors