Grouping the suggestions by number of 1UP Votes

in #utopian-io8 years ago

image.png

As you may know, I am teaming up with @flauwy to build the Utopian 1UP button that will allow a goud amount of curation rewards for those following the trail to frontrun the best contributions on Utopian.

After my last iteration, @flauwy that he would rather have the suggestions grouped by number of 1UP votes, than a list of every vote ever made.

Implementing this was a bit trickier than it sounds since I am using Parse Server in the backend and it wants to add each vote received as a new Object in the Suggestion Collection. Thankfully, I learned to use the Cloud within Parse to perform this operation. What is actually happening:

  • In the BeforeSave function, I check if there is already a Suggestion with the same Url
  • If no, create a new Suggestion
  • If yes, create a new Suggestion and add the previous voters for this url, then delete the old suggestion

I also added a mechanism to reject double upvote from the same person on the same url:

image.png

... and sorted the suggestions by number of upvotes without displaying them:

image.png

You can check it out on Heroku here, and find the merged Pull Request in here.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

I love what you guys are doing here - keep up the great work!

You can contact us on Discord.
[utopian-moderator]

Will do! Thank you :)

1up-logo.png


You've got a 1UP from the @utopian-1up curation trail. 43 Utopians have upvoted your quality contribution to the open source community.

Join 1UP for better posts and high curation rewards.

1UP is neither organized nor endorsed by Utopian.io!

I will follow this trail as soon as I get to my laptop n.n it is becoming really interesting :)

Welcome aboard

Thanks for the information

Hey @stoodkev I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

You have (8) of reputation and still sending BS comments, will you get it at some point?

Unfortunately, I don't think this kind of thing will ever end. It is too trivial to make a new account if your rep drops too low...

Yea, I just wish new users could understand they won t get any profit this way..

Coin Marketplace

STEEM 0.08
TRX 0.29
JST 0.035
BTC 107658.88
ETH 3776.61
USDT 1.00
SBD 0.59