Updates on Utopian-1UP backend
utopian-io·@stoodkev·
0.000 HBDUpdates on Utopian-1UP backend
 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](https://steemit.com/1up/@utopian-1up/utopian-1up-a-sophisticated-curation-trail-for-utopian-io-version-1-0) 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](https://steemit.com/utopian-io/@steem-plus/steemplus-2-4-utopian-1up-is-here) 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 <br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@stoodkev/updates-on-utopian1up-backend">Utopian.io - Rewarding Open Source Contributors</a></em><hr/>
👍 rayday, stoodkev, richardalom, realinfo, hakancelik, steemitstats, tuanis, jejangkit, steemline, oboy, hag228, macchiata, moorkedi, caribbeancrypto, st3llar, dailychina, superbing, justyy, dailystats, happyukgo, dailyfortune, deanliu, ewq, fanbasefr, wargof, lpv, fabinhocrypto, duke77, slashformotion, gwys, gribouille, worldiz, florenceboens, forexflo, addictiv, hellofuture, didizion, imcore, yann85, jane83, tyjulie, cryptofrench, studio666, itharagaian, lebastion, bartosz546, jegede, shieha, lydiachan, hd12, dreamdev, pml2020, flugschwein, read3986, kelos, thesport, zonguin, baloox, leguidecrypto, galam, eagle42, costanza, harpagon, skarnoze, runicar, edywill, markush, dailythoughts, jpederson96, sagitta6, jemjewl, gabrielarbie10, ivone-cacador, spederson, cifer, olyup, dante01, utopian-1up, helo, flauwy, mahdiyari, simonluisi, ansonoxy, espoem, not-a-bird, bitopia, maphics, phgnomo, proffgodswill, sweeverdev, yeswanth, howtosteem, thatmemeguy, ronimm, mufasatoldyou, thinkkniht, onos, jesdn16, jamesbarraclough, kslo, navx, sebastiengllmt, zlatkamrs, amosbastian, bobsthinking, rhotimee, deejee, roj, nightdragon, opulence, dexter24, dyancuex, luisrod, varja, isacastillor, jerybanfield, rsteem, lemony-cricket, exploreand, photohunter1, photohunter2, photohunter3, photohunter4, photohunter5, xtramedium, zoneboy, barut, yourmercury, acrywhif, patatesyiyen, onin91, isabella394, zinonweke, emailbox19149, petvalbra, olayhemy, fmbs25, livsky, killbill73, amirdesaingrafis, fai.zul, heshe-f, crispycoinboys, bluestorm, pepememes, flugbot, ilyastarar, jfuenmayor96, smafey, timmyeu, maaz23, steaknsteem, eleonardo, carsonroscoe, hrishikeshmatre, anmeitheal, solomon507, matthewthonyit, kaking, aderemi01, reazuliqbal, aliyu-s, derasmo, steemlore, member9, drigweeu, toninux, fabiocola, neneandy, rogerek, odibezeking, mrmaracucho, adol, jdc, devilonwheels, blaize-eu, abreu, dwayne16, bargolis, phasma, hillaryaa, idlebright, adhew, jrmiller87, gwapoaller, genoner, cashthekush, lovenfreedom, kenn24, teamsteem, berkah, mrs.agsexplorer, pnc, bitcoiner, greenstar, sambillingham, johnesan, camaund, motlhamme, stegglez, hectorzs, richardbmx, ultraspace, oknowsteem, arcjen02, mikefrancis, jaymz, maggiea, utopian-io, steemthinkcom, syarkawi,