Broadcast a new post + bug fixes
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

Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @walnut1 I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x