Development of Resteemit

in #utopian-io7 years ago (edited)

resteemit contribution.png


This is my first mirged contribution to the development of resteemit by adding some new advanced changement in the Script.


Resteemit.com is a Public Curation Project
Resteemit take any steemit article and resteem it on @resteemable, from where the post is upvoted by the resteemable trail.


Project by @gktown he was giving 10% upvote for every resteemed postes ,
He asked to create a system that either monitors current vote power or counts the number of votes given in a 24 hour period. we need to vote all resteemed posts in 24h with using 20% of power .

After alot of discussions we decided to give a 100% vote every 2H20MIN to satisfy resteemit.com users.

Changement summary :

  • Add configured variables in top of file .
  • Add new module
  • Add new function that allow Resteemit to sleep in a specified time
  • Add time Calculator to log time left for next vote
  • Add Function that Push reblogged postes in a list(Array) when Bot is sleeping
    and after is awake -it will share a specified vote with the total of posts resteemed.


    First steep i added botSleep function that make bot sleep in a specified time , it can be configured from the variable Bconfig .


    Next step is the fuction resteemable it containe a lot og things , at every request to resteemit.com this function is called .

    Whith this condition if(SleepAt > CurrentDate)we check if the bot still sleeping or not , if is sleeping we push poste info with
    awaitingPosts.push(Suser+"//"+Stitle); into array awaitingPosts also we log time left for bot to wake up .

var s = ((SleepAt - CurrentDate) / 60000)*60 ;
var h = s / 60 / 60 ;
var m = s / 60 ;
if(h > 4){m = m -240;h = 4}
else if(h > 3){m = m -180;h = 3}
else if(h > 2){m = m -120;h = 2}
else if(h > 1){m = m -60;h = 1}
else if(h < 1){m = m ;h = 0}
var m = (m+"").split(".")[0];
var s = s - ( (h * 60 *60)+ (m *60));
console.log("Bot awake in : "+h + " H " +m+ " M "+s.toFixed(0)+ " S " );



If bot is awake we get total resteemed posts var totalAwaitPosts = awaitingPosts.length; and we count how much vote percent we will give to every post votingPower = Math.round(((Bconfig[3] / totalAwaitPosts) *100) * 1) / 1 ; and exporting awaitingPosts array to array **PostsToVote ** to make new resteemed posts await to next vote .

And we vote all pending postes one by one in for function

for(var i=0; i<PostsToVote.length; i++){
var u_a_p = PostsToVote[i].split("//"); // username and permlink
console.log("Voting for "+u_a_p[0]+" permlink : "+u_a_p[1]);
vote(u_a_p[0],u_a_p[1]);
......................



I've added system-sleep module var sleep = require('system-sleep'); to make time betwin every vote because steemit allow only 3s betwin two votes , sleep(6000);.


When bot finish voting all postes we call it to sleep botSleep(Bconfig[0],Bconfig[1]);


Cheers!


Task link : https://utopian.io/utopian-io/@gktown/resteemit-com-roadmap-seeking-developers
Project link : https://github.com/gktown/resteemit
Pull request link : https://github.com/gktown/resteemit/pull/1



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

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

thank you.

Your contribution cannot be approved yet because it is not as informative as other contributions. See the Utopian Rules. Please edit your contribution and add try to improve the length and detail of your contribution (or add more images/mockups/screenshots), to reapply for approval.

Please see the rule 'Contributions MUST BE Informative and Narrative' and tell us a bit more about what you did. The pull request is named Update server.js and did not help at all in understanding what you contributed to the project.

You may edit your post here, as shown below:

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

thank you for help .

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

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • 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

Great work @sweever. Sorry I missed your contribution post, I was away on vacation. I will be announcing the launch of your update soon.

thank you dear.

Coin Marketplace

STEEM 0.16
TRX 0.16
JST 0.028
BTC 68431.46
ETH 2457.08
USDT 1.00
SBD 2.60