1UP : Trail tail and other trailing accounts by stoodkev

View this thread on steempeak.com
· @stoodkev · (edited)
$55.28
1UP : Trail tail and other trailing accounts
<div><p><img src="https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmdxu3XEBifqSDbCrRqmjkVk8FaFMBRyJwv8LdiAXw7wsZ/image.png"></p>
<h4>Repository</h4>
<p><a href="https://github.com/therealFlauwy/1UP" rel="noopener" title="This link will take you away from steemit.com">https://github.com/therealFlauwy/1UP</a></p>
<p>Following this <a href="https://steemit.com/utopian-io/@flauwy/developer-wanted-for-the-1up-curation-system-with-smt-bounty">post</a> from <a href="/@flauwy">@flauwy</a>, I've been tasked to start the creation of the new 1UP.<br>
As a reminder, <a href="/@utopian-1up">@utopian-1UP</a> was an Utopian bot front-runner in which members of the community would decide which are the best posts to vote for. the <a href="/@utopian-1up">@utopian-1up</a> would then vote for the best post every 2.4 hours, followed by hundreds of curators in the trail.</p>

<h3>New Features</h3>
<h4>Distinction between the different types of trail</h4>

If you have followed my work on 1UP, you saw that I ve already coded a route that helps administrators generating a random link that can be used to set the community whale on the trail.

In my idea, the community started a trail, followed by all the users in the trail, after what the whale would end up the voting round. What I didn't understand correctly is that the "normal" user accounts of the trail were to be added directly on 1UP website rather than other service (such as SteemAuto).

Therefore I had to change a big portion of the code and add some new routes in order to distinct these two different types of trail, as shown in this graph:

![](https://cdn.steemitimages.com/DQmegeipW3TKbWcCyjfhuwnnmpVJYZdbhiZmtppDktAfFwH/image.png)

When the trail tail (the community whale) reaches 100% Voting Power a vote will be cast in this manner : 
- users will upvote sorted by increasing vote value
- tail trail will upvote
- 1UP will upvote

In order to make this possible, I needed to get the `offline` token from the users. But since some don t like to give this permission, I didn't include it in the normal login. Users can now follow a trail directly from a community view page : 

![](https://cdn.steemitimages.com/DQmYmaxdLPECWM5VrrprNfq55hpchCSmXXxoXMwzExTY5DM/image.png)


Once again, I know it s ugly, but the css has not been implemented yet .

If they never gave the offline permission yet, they will be redirected to SteemConnect, if they did, they will join the trail instantly. 

I have also moved the functions to an `utils.js` file.

### Future work

- Fetch the posts the post corresponding to the community criteria
- Display these posts and allow 1UP votes on it 
- Vote on the best post of the period

<h3>Live Demo</h3>
<p>As a demonstration speaks more than lots of words, I ve put back online the old Utopian1UP website. You can try by yourself and create a community and link a trail to it for testing purposes.<br>
No votes will be casted do not worry, but it's an offline token so, for safety reasons, I would recommend using a test account.</p>
<p><a href="https://utopian-1up.herokuapp.com" rel="noopener" title="This link will take you away from steemit.com">Live Demo</a></p>
<h4>Pull Request</h4>
<p><a href="https://github.com/therealFlauwy/1UP/pull/47" rel="noopener" title="This link will take you away from steemit.com">Trail tail and other trailing accounts</a></p>
<h4>GitHub Account</h4>
<p><a href="https://github.com/stoodkev" rel="noopener" title="This link will take you away from steemit.com">https://github.com/stoodkev</a></p>
</div>

<center>
<a href="https://steemfest.com"><img src="https://files.steempeak.com/file/steempeak/rubencress/TdasrV2W-steemfest-round-corner.png" alt="Meet me at SteemFest 2018 in Kraków" /></a>
</center>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 41 others
properties (23)
post_id61,984,128
authorstoodkev
permlink1up--trail-tail-and-other-trailing-accounts
categoryutopian-io
json_metadata{"tags":["utopian-io","development","dev","steemdev","news"],"image":["https:\/\/steemitimages.com\/0x0\/https:\/\/cdn.steemitimages.com\/DQmdxu3XEBifqSDbCrRqmjkVk8FaFMBRyJwv8LdiAXw7wsZ\/image.png"],"links":["https:\/\/github.com\/therealFlauwy\/1UP","https:\/\/steemit.com\/utopian-io\/@flauwy\/developer-wanted-for-the-1up-curation-system-with-smt-bounty","\/@flauwy","\/@utopian-1up","https:\/\/utopian-1up.herokuapp.com","https:\/\/github.com\/therealFlauwy\/1UP\/pull\/47","https:\/\/github.com\/stoodkev","https:\/\/steemfest.com"],"app":"steemit\/0.1","format":"markdown"}
created2018-09-09 08:57:36
last_update2018-09-11 19:15:39
depth0
children8
net_rshares54,359,775,177,046
last_payout2018-09-16 08:57:36
cashout_time1969-12-31 23:59:59
total_payout_value42.338 SBD
curator_payout_value12.946 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length3,748
author_reputation89,353,405,873,727
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries
0.
weight100
accountsteemplus-pay
1.
weight500
accountutopian.pay
max_accepted_payout100,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (105)
@tekendra ·
better idea
properties (22)
post_id61,984,555
authortekendra
permlinkre-stoodkev-1up--trail-tail-and-other-trailing-accounts-20180909t090355826z
categoryutopian-io
json_metadata{"links":[],"tags":["utopian-io"],"image":[],"format":"markdown","app":"busy\/2.5.6","community":"busy","users":[]}
created2018-09-09 09:05:54
last_update2018-09-09 09:05:54
depth1
children0
net_rshares0
last_payout2018-09-16 09:05:54
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_length11
author_reputation7,079,457,843
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@justyy ·
$10.96
Thank you for your contribution.

1. you can simply include the bootstrap css to make button/text look a lot nicer than the plain ones.
2. You could use ES6 syntax e.g. `[a[i], a[j]] = [a[j], a[i]];` to swap two elements e.g. in your Array Shuffle function.

PS: I personally don't like others to store my offline tokens unless I know there are stronger security preventions. 


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

---- 
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,009,619
authorjustyy
permlinkre-stoodkev-1up--trail-tail-and-other-trailing-accounts-20180909t153932882z
categoryutopian-io
json_metadata{"app":"steemit\/0.1","links":["https:\/\/join.utopian.io\/guidelines","https:\/\/review.utopian.io\/result\/3\/2322222","https:\/\/support.utopian.io\/","https:\/\/discord.gg\/uTyJkNm","https:\/\/join.utopian.io\/"],"tags":["utopian-io"]}
created2018-09-09 15:39:33
last_update2018-09-09 15:39:33
depth1
children1
net_rshares10,309,240,340,354
last_payout2018-09-16 15:39:33
cashout_time1969-12-31 23:59:59
total_payout_value8.346 SBD
curator_payout_value2.616 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length868
author_reputation2,057,469,156,047,835
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (14)
@utopian-io ·
Thank you for your review, @justyy!

So far this week you've reviewed 1 contributions. Keep up the good work!
properties (22)
post_id62,480,954
authorutopian-io
permlinkre-re-stoodkev-1up--trail-tail-and-other-trailing-accounts-20180909t153932882z-20180915t022016z
categoryutopian-io
json_metadata{"app":"beem\/0.19.42"}
created2018-09-15 02:20:18
last_update2018-09-15 02:20:18
depth2
children0
net_rshares0
last_payout2018-09-22 02:20:18
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_length109
author_reputation152,913,012,544,965
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steem-ua ·
#### Hi @stoodkev!

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,010,939
authorsteem-ua
permlinkre-1up--trail-tail-and-other-trailing-accounts-20180909t155646z
categoryutopian-io
json_metadata{"app":"beem\/0.19.54"}
created2018-09-09 15:56:48
last_update2018-09-09 15:56:48
depth1
children0
net_rshares0
last_payout2018-09-16 15:56: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_length287
author_reputation23,203,609,903,979
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@clixmoney ·
Thanks a lot for being such good witness, I updated my vote, I do that every 2-3 months and I'm still voting you as a witness and I included you in this post to introduce you to a very good steemian : [One of the best steemians](https://steemit.com/dtube/@clixmoney/5tu5hpym)
properties (22)
post_id62,113,209
authorclixmoney
permlinkre-stoodkev-1up--trail-tail-and-other-trailing-accounts-20180910t200917192z
categoryutopian-io
json_metadata{"links":["https:\/\/steemit.com\/dtube\/@clixmoney\/5tu5hpym"],"app":"steemit\/0.1","tags":["utopian-io"]}
created2018-09-10 20:09:18
last_update2018-09-10 20:09:18
depth1
children0
net_rshares0
last_payout2018-09-17 20:09:27
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_length275
author_reputation506,342,573,332,958
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@utopian-io ·
Hey, @stoodkev!

**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,291,902
authorutopian-io
permlinkre-1up--trail-tail-and-other-trailing-accounts-20180912t203548z
categoryutopian-io
json_metadata{"app":"beem\/0.19.42"}
created2018-09-12 20:35:51
last_update2018-09-12 20:35:51
depth1
children0
net_rshares0
last_payout2018-09-19 20:35:51
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_length590
author_reputation152,913,012,544,965
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steemitboard ·
Congratulations @stoodkev! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

[![](https://steemitimages.com/70x80/http://steemitboard.com/notifications/payout.png)](http://steemitboard.com/@stoodkev) Award for the total payout received

<sub>_Click on the badge to view your Board of Honor._</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-witness-update-2018-09-07"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/7CiQEO.png"></a></td><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-witness-update-2018-09-07">SteemitBoard - Witness Update</a></td></tr></table>

> You can upvote this notification to help all Steemit users. Learn why [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)!
properties (22)
post_id62,346,167
authorsteemitboard
permlinksteemitboard-notify-stoodkev-20180913t124826000z
categoryutopian-io
json_metadata{"image":["https:\/\/steemitboard.com\/img\/notify.png"]}
created2018-09-13 12:48:24
last_update2018-09-13 12:48:24
depth1
children0
net_rshares0
last_payout2018-09-20 12:48:24
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_length1,030
author_reputation38,705,954,145,809
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@flauwy ·
Nice one, good to see you tackled that already. I have missed the post so I put you in my Steemify app so that does not happen again. 

I have tested the formular and it works. The process is pretty clear I think. There is a little bug though, when I click on the username dropdown it immediately selects the top link. I can avoid it by not releasing my mouse and scroll over the other links and then release, that's why I was able to test it.
properties (22)
post_id62,395,312
authorflauwy
permlinkre-stoodkev-1up--trail-tail-and-other-trailing-accounts-20180914t013235147z
categoryutopian-io
json_metadata{"app":"steempeak","tags":["utopian-io"],"community":"steempeak"}
created2018-09-14 01:32:36
last_update2018-09-14 01:32:36
depth1
children0
net_rshares0
last_payout2018-09-21 01:32: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_length443
author_reputation242,971,623,482,939
root_title"1UP : Trail tail and other trailing accounts"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000