©
Today I share with you a simple script that you can use in contests to extract a winner chosen randomly from your commenters. The result is independent from how many times an account commented.
Here it is:
var comments = document.getElementById('#comments');
var commentsEntities = comments.querySelectorAll('a[class="ptc"]');
var allComments = Array.prototype.slice.call(commentsEntities);
var allCommenters = [...new Set(allComments.map(e => e.innerText.split(' ')[0]))];
var randomId = Math.floor(Math.random()*allCommenters.length-1)+1;
alert('The winner is... ' + allCommenters[randomId]);
To execute it all you have to do is open the browser console on the steemit page with your contest, paste the script and press enter. To re-run the extraction paste again the script and press enter.
(If you have a basic knowledge of javascript you can check yourself that this script is absolutely safe)
Enjoy! =)
Contest creators that may find this useful:
@rentmoney, @bunnypuncher, @flamingirl, @cryptogangz, @rufruf, @mikepm74, @zipsardinia, @follwoforupvotes, @viraldrome, @pundito, @playdice, ...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks, I'm not a developer. I'm studying js to turn my contest into an automated bot. I'll try your script right away.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Ok @zipsardinia, let me know if it worked ok!
I did not test it on all browsers (but should be ok as it is).
Thanks =)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
sei italiano! ho provato sia su frefox che su chrome. Mi da come vincitore sempre lo stesso.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@zipsardinia Yup, tu sardegna? ( :
Mm, strano dammi il post su cui l'hai provato. A me funziona sia su Chrome che su FF.
(chiaramente te sei escluso dall'estrazione quindi ci devono essere commenti di altri..)
Your name won't come out from the extraction, you need at least a comment from another user
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
E per verificare che utenti ha effettivamente trovato nei commenti puoi sempre digitare in console allCommenters e premere invio..
and if you want to verify which users were found in your comments just type allCommenters in the console and press enter
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Funziona! Ho provato su questo post. Bravo! Alcune parti del codice non mi sono ancora chiare. Settimana prossima ho una lezione di js con un ragazzo che ho conosciuto qui. Spero presto di capirci qualcosa di più.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Good luck! =D
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
free resteemed follow upvote done by @michealclauri
upvote my comment please
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Free resteem+ upvote courtesy of @untapentuoreja
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @gaottantacinque! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of comments received
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
this is really nice
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i will participate in this comment contest
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@amritmahal this is not a contest. Here I only shared the script that anyone can use in their contest to extract a winner. : )
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i check your service if your service is good i will participate next contest
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@amritmahal this is not a contest. Here I only shared the script that anyone can use in their contest to extract a winner. : )
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Good stuff! =)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Flaged for multiple account spam, comment spam and tag spam.
the accounts of the spammer:
main account:
https://steemit.com/@gaottantacinque
spam accounts:
https://steemit.com/@gasaeightyfive
https://steemit.com/@marcocasario
https://steemit.com/@cribbio
automated comment spam:
https://steemit.com/@marcocasario/comments
our tags he is spamming:
#resteembot, #bestofresteembot, #winwithresteembot, #resteembotvip
@resteem.bot
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit