Utopian.rocks - Category filtering, moderator comments feed by amosbastian

View this thread on steempeak.com
· @amosbastian · (edited)
$83.95
Utopian.rocks - Category filtering, moderator comments feed
<center>![](https://i.imgur.com/5rAMEOj.png?1)
<sup>Credit to @podanrj</sup>
https://utopian.rocks/
</center>

### 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

<center>![filtering_categories.gif](https://cdn.steemitimages.com/DQmSQR8rUaBZLhUH73jmp9ptrvbAbgiVatgsyiKCq3qUuqu/filtering_categories.gif)</center>

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

<center>![moderator_comment.gif](https://cdn.steemitimages.com/DQmX1x1kASdWDmBioXkByxVppbWhuKmxaHeu3dgJmB8Rq5p/moderator_comment.gif)</center>

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).

```python
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](https://github.com/amosbastian/utopian.rocks/issues). Thanks!
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id62,389,907
authoramosbastian
permlinkutopian-rocks---category-filtering-moderator-comments-feed
categoryutopian-rocks
json_metadata{"format":"markdown","links":["https:\/\/utopian.rocks\/","https:\/\/github.com\/amosbastian\/utopian.rocks","https:\/\/github.com\/amosbastian\/utopian.rocks\/pull\/25","https:\/\/github.com\/amosbastian\/utopian.rocks\/issues"],"users":["podanrj"],"tags":["utopian-rocks","utopian-io","development"],"image":["https:\/\/i.imgur.com\/5rAMEOj.png?1"],"app":"steemit\/0.1"}
created2018-09-13 23:45:33
last_update2018-09-13 23:46:18
depth0
children6
net_rshares78,865,015,920,126
last_payout2018-09-20 23:45:33
cashout_time1969-12-31 23:59:59
total_payout_value62.833 SBD
curator_payout_value21.120 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length3,368
author_reputation174,225,255,912,876
root_title"Utopian.rocks - Category filtering, moderator comments feed"
beneficiaries
0.
accountutopian.pay
weight500
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (32)
@mwfiae ·
Great post and very nice addition! 

It's also very practical for utopian curators ;)
properties (22)
post_id62,418,791
authormwfiae
permlinkre-amosbastian-utopian-rocks---category-filtering-moderator-comments-feed-20180914t084306822z
categoryutopian-rocks
json_metadata{"tags":["utopian-rocks"],"app":"steemit\/0.1"}
created2018-09-14 08:43:06
last_update2018-09-14 08:43:06
depth1
children1
net_rshares0
last_payout2018-09-21 08:43:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length85
author_reputation8,643,042,860,748
root_title"Utopian.rocks - Category filtering, moderator comments feed"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@amosbastian · (edited)
Thanks and good point, I didn't really think of that!
properties (22)
post_id62,421,147
authoramosbastian
permlinkre-mwfiae-re-amosbastian-utopian-rocks---category-filtering-moderator-comments-feed-20180914t092335595z
categoryutopian-rocks
json_metadata{"app":"steemit\/0.1","tags":["utopian-rocks"]}
created2018-09-14 09:23:36
last_update2018-09-14 09:23:51
depth2
children0
net_rshares0
last_payout2018-09-21 09:23:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length53
author_reputation174,225,255,912,876
root_title"Utopian.rocks - Category filtering, moderator comments feed"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@emrebeyler ·
$11.70
Great news! I have started liking the new interface. :) 

After the filtering on categories, contribution count stays the same. Maybe recalculating and updating it for the corresponding category would be better.

***


Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/1222212).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , , , , , , , ,
properties (23)
post_id62,426,070
authoremrebeyler
permlinkre-amosbastian-utopian-rocks---category-filtering-moderator-comments-feed-20180914t104519175z
categoryutopian-rocks
json_metadata{"app":"steemit\/0.1","tags":["utopian-rocks"],"links":["https:\/\/join.utopian.io\/guidelines","https:\/\/review.utopian.io\/result\/3\/1222212","https:\/\/support.utopian.io\/","https:\/\/discord.gg\/uTyJkNm","https:\/\/join.utopian.io\/"]}
created2018-09-14 10:45:18
last_update2018-09-14 10:45:18
depth1
children1
net_rshares10,381,179,775,104
last_payout2018-09-21 10:45:18
cashout_time1969-12-31 23:59:59
total_payout_value9.736 SBD
curator_payout_value1.963 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length708
author_reputation319,480,565,467,431
root_title"Utopian.rocks - Category filtering, moderator comments feed"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (9)
@utopian-io ·
Thank you for your review, @emrebeyler!

So far this week you've reviewed 5 contributions. Keep up the good work!
properties (22)
post_id62,757,506
authorutopian-io
permlinkre-re-amosbastian-utopian-rocks---category-filtering-moderator-comments-feed-20180914t104519175z-20180919t014047z
categoryutopian-rocks
json_metadata{"app":"beem\/0.19.42"}
created2018-09-19 01:40:48
last_update2018-09-19 01:40:48
depth2
children0
net_rshares0
last_payout2018-09-26 01:40:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length113
author_reputation152,913,012,544,965
root_title"Utopian.rocks - Category filtering, moderator comments feed"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steem-ua ·
#### Hi @amosbastian!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
post_id62,429,657
authorsteem-ua
permlinkre-utopian-rocks---category-filtering-moderator-comments-feed-20180914t114420z
categoryutopian-rocks
json_metadata{"app":"beem\/0.19.54"}
created2018-09-14 11:44:21
last_update2018-09-14 11:44:21
depth1
children0
net_rshares0
last_payout2018-09-21 11:44:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length290
author_reputation23,203,609,903,979
root_title"Utopian.rocks - Category filtering, moderator comments feed"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@utopian-io ·
Hey, @amosbastian!

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

**Get higher incentives and support Utopian.io!**
 Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)).

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

<a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
post_id62,863,668
authorutopian-io
permlinkre-utopian-rocks---category-filtering-moderator-comments-feed-20180920t092108z
categoryutopian-rocks
json_metadata{"app":"beem\/0.19.42"}
created2018-09-20 09:21:09
last_update2018-09-20 09:21:09
depth1
children0
net_rshares0
last_payout2018-09-27 09:21:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length593
author_reputation152,913,012,544,965
root_title"Utopian.rocks - Category filtering, moderator comments feed"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000