
Credit to @podanrj
https://utopian.rocks/
Repository
https://github.com/amosbastian/utopian.rocks
Pull request
https://github.com/amosbastian/utopian.rocks/pull/25
Since I'm really only interested in contributions from the best category, also known as the development category, I've added a way to filter the contributions by a specific category. I've also added a new page that shows all the comments made by moderators that are waiting to be upvoted, which should also be useful for community managers wanting to check the comments made by moderators in their category.
Filtering by category

I'm very new to actually using JavaScript, so this took way longer than it should've. It can also probably be done in a better way, but I'm still learning and it does work, so bear with me. The implementation is as simple as you would expect: if you click on a category's icon it removes the class "show" from each contribution that isn't part of that category. It also removes the "category--inactive" class from the icon, so its colour is set to the category's colour when clicked. Simple, but effective!
Moderator comment feed

This took a little while to implement as well. Before this update the contributions in my database didn't include the actual review date (only the day, not the time), nor the URL of the moderator's comment. Once this was added I needed a way to figure out when a moderator's comment is upvoted. Luckily enough the way the bot behaves is pretty simple: if it reaches 99.75% then it upvotes the oldest pending contribution and the oldest pending moderator comment if it is older than 2 days. This means that there are many more comments waiting to be upvoted than contributions, and so it's impossible to estimate the upvote time of some comments. To remedy this I simply use the same code as last time, but user itertool's zip_longest
to zip the comments along the contributions, and assign the vote time to the comment if the contribution exists, and otherwise set it as TBD (to be determined).
for comment, contribution in zip_longest(comments, contributions):
if contribution:
comment["vote_time"] = contribution["vote_time"]
else:
comment["vote_time"] = "TBD"
I also decided to add the comment permlink to the contributions in the database, so it's easy for people to quickly navigate to the moderator's comment. Of course also all of the other URLs that would normally link to contributors have now been changed to link to the moderator's respective pages, and the red/green bar on the side shows if a moderator's comment is eligible for an upvote.
This will more than likely be the final thing I add to Utopian.rocks for a while, because I have run out of ideas and want to focus on other projects for now! However, if there is really is something cool you need to see added, then don't hesitate to create an issue here. Thanks!