"Resteemit.com" | Fix bugs & run service for better process

in #utopian-io7 years ago (edited)

contribution.png

<p dir="auto"><br /><br /> This is my secend contribution to the development of <strong><span>resteemit.com Project by <a href="/@gktown">@gktown<br /> <br /><br /> <strong>Resteemit.com is a Public Curation Project<br /><br /> <br /><br /> <br /><span> Resteemit take any steemit article and resteem it on <a href="/@resteemable">@resteemable, from where the post is upvoted by the resteemable trail. <p dir="auto"><h3>Changement summary :<p> <ul> <li><h6>Add log for voted posts & resteemed posts. <li><h6>Add new vote function & renew old one. <li><h6>Add interval checker <li><h6>Add comment functionality <li><h6>Fix duplicated comments <p dir="auto"><br /> <h3>- Add log for voted posts & resteemed posts. <p dir="auto">I added log to the console for both functions : <ul> <li><strong>vote <br /> <code>if(err){console.log(err)}; <li><strong>resteem<br /> <code>if(err){console.log(err)};if(result){console.log("Resteem Succes for "+user)}<br /> <br /><br /> After i've add a new vote function <code>voteAwaitingpostes , because in the last one , the log show only the first post upvoted in <code>for methode . <blockquote> <p dir="auto">var voteAwaitingpostes = function()<br /> {<br /> var totalAwaitPosts = awaitingPosts.length;<br /> if( totalAwaitPosts > 1)<br /> {<br /> console.log("Bot is ready !!");<br /> ...................... <p dir="auto">And for the old fuction <code>resteemable i let only time logger & line to push reblogged postes in the <strong>Array . <h4>- Add interval checker : <p dir="auto">for a better process , this <code>Intervel will check if bot (awake or sleep) with condition <code>if(SleepAt < CurrentDate) every <strong>10s ,<br /> if so bot sleep again and <code>voteAwaitingpostes function called <blockquote> <p dir="auto">setInterval(function() {<br /> var CurrentDate = Date.now();<br /> if(SleepAt < CurrentDate)<br /> {<br /> ................ <h3>- Add comment functionality <p dir="auto">I've add <code>doComment function for commenting to voted postes , also to notify to users that the service is working . <blockquote> <p dir="auto">var doComment = function(Vuser,Permlink){<br /> var comment = "---------------------."; <pre><code>var commentPermlink = steem.formatter.commentPermlink(voter, Permlink); ......................... <p dir="auto">Next i implement it in <code>voteAwaitingpostesfunction after <strong>vote function , and i set a timout to 20s betwin every (comment & vote) , because steemit allow only to comment 1 time every <strong>20s. <blockquote> <p dir="auto">doComment(u_a_p[0],u_a_p[1]);<br /> sleep(20000); <h3>- Fix duplicated comments <p dir="auto">I've added <code>Duplicated function that check if submitted posts already exist or not... <blockquote> <p dir="auto">var Duplicated = function(Suser,Stitle)<br /> {<br /> for(var i=0; i<awaitingPosts.length; i++){<br /> ........................ <p dir="auto">then i implement it in <code>resteemable function , the idea is befor adding post to awaiting list we call <code>duplicated function that return <strong>true or <strong>false , so we check if true we add post to the list , if not we log to console . <blockquote> <p dir="auto">if(!Duplicated(Suser,Stitle))awaitingPosts.push(Suser+"//"+Stitle);<br /> else console.log("Duplicated Poste : " + Suser+" - " + Stitle); <p dir="auto"><br /> <h5>Note : all changement are made in one file <em><code>server.js <p dir="auto"><br /><br /><br /> Pull requests links :<br /> <a href="https://github.com/gktown/resteemit/pull/3" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">PR #3<br /> <a href="https://github.com/gktown/resteemit/pull/4" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">PR #4<br /> <a href="https://github.com/gktown/resteemit/pull/8" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">PR #8<br /> <br /><span> Project link : <a href="https://github.com/gktown/resteemit" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/gktown/resteemit <h6>Cheers! <p dir="auto"><br /> <p dir="auto"><br /><hr /><em>Posted on <a href="https://utopian.io/utopian-io/@sweeverdev/resteemit-com-or-fix-bugs-and-run-service-for-better-process" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Utopian.io - Rewarding Open Source Contributors<hr /><p>
Sort:  

Great work @sweeverdev -- Resteemit.com is looking better and better all the time thanks to you.

thank you very much , i'm looking to make it more better in the future :)

Thank you for the contribution. It has been approved.

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

Hey @sweeverdev 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