Updates on Utopian-1UP backend

in #utopian-io7 years ago (edited)

image.png

If you don't know how to use Utopian-1UP to improve your curation rewards wile supporting the best Utopian contributors, please read this post from @flauwy.
I went back to work on Utopian-1UP for a little while in order to improve user experience and avoid future bugs.
Mostly this Pull request focuses on the three following aspects:

  • Making sure 1UP won't upvote and or comment posts older than 7 days, would be such a waste, right =p
  • Further sorting of the posts
  • Interdiction of using 1UP for voting for task requests

New Features

7 days threshold

That might look like a stupid mistaked but I originally thought that there was no way that a post reached the 7 days while still being in the 1UP voting list. Why so? Because a post on Utopian 1UP has already been accepted by a moderator and will disappear of the list when it is voted by either the trail or the bot. But then, the impossible happened :o A post was accepted by a moderator but not by the bot (accepted too late), and 1UP tried to upvote that. Not good, that's a no no.
Therefore, I totally refractored the database by making an additional call to the Post Information and saving its creation date.

Then, posts older than 7 days will never appear on the current voting list, nor will be upvoted/ commented by the trail.

Sorting

Originally, the posts are sorted by number of 1UP votes only, I have added a second algorithms to further sort posts with the same number of 1UP votes. The first one to have reached this number of votes will be shown first.

The second degree sorting algorithm can be found below:

  posts=posts.sort(function(a,b){
              if(a.get('from_length')>b.get('from_length'))
                return -1;
              else if(b.get('from_length')>a.get('from_length'))
                return 1;
              else
                return a.get('createdAt')-b.get('createdAt');
});
Tasks request

Tasks requests are set to change in Utopian and will be accepted automatically and not upvoted by the bot. For this reason, we have to stop accepting Task Requests as valid Utopian contributions. In the future, I will hide the 1UP buttons directly from SteemPlus for avoiding to show it on the Utopian website. For now, I am checking it directly on the backend. When someone vote for a new post, it will check on the json_metadata if the category is a task request and will refuse the request if so.

Future developements

Although SteemPlus is great (I'm not biased here =D ), it will be important for 1UP growth to add the possibility to vote directly from the frontend. I will discuss furthermore with @flauwy to see how to implement that.

Hope this helps!

@stoodkev for 1UP



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Great to see some progress for 1UP. I will also have to sit down and write a simplified "What is 1UP" so we can discuss further things with potential supporters.

Thank you for the contribution. It has been approved.

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

These sound like great, common-sense updates. I've been following this project for a long time now.

@stoodkev, Upvote is the only thing I can support you.

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.030
BTC 65185.94
ETH 2630.94
USDT 1.00
SBD 2.83