Skip to content

Instantly share code, notes, and snippets.

@arleslie
Created January 27, 2016 16:28
Show Gist options
  • Save arleslie/2a8debc4a25cad7b4c76 to your computer and use it in GitHub Desktop.
Save arleslie/2a8debc4a25cad7b4c76 to your computer and use it in GitHub Desktop.
Dailybreak auto bot
function scrollForPoints() {
var current = $('span.points').text();
function scroll() {
var bottemReached = $(window).scrollTop() + $(window).height() == $(document).height();
if (current === $('span.points').text()) {
if (bottemReached) {
window.scrollTo(0,0);
alert('poll');
} else {
window.scrollBy(0, 60);
setTimeout(scroll, 20);
}
} else {
loadNewsPage();
}
}
scroll();
}
function loadNewPage()
{
$($('div.award > span').parent().siblings('.image').children('a')[1]).click();
setTimeout(scrollForPoints, 3000);
}
function loadNewsPage()
{
$('.nav-item.open').trigger('click');
setTimeout(loadNewPage, 2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment