Last active
August 29, 2015 14:08
-
-
Save amytych/0ecc15c5d5676c8d0219 to your computer and use it in GitHub Desktop.
Fito Props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sometimes activity stream is so long | |
// it's not possible to keep up with it | |
// and everyone deserves a prop for their effort | |
var propCounter = 0; | |
var interval = setInterval(function() { | |
var $propers = $('.give_prop'), $proper; | |
if ($propers.length) { | |
$proper = $propers.first(); | |
console.log($proper.parents('.stream_item').find('.stream-author').text()); | |
$("html, body").animate({ scrollTop: $proper.offset().top }, 150); | |
$proper.trigger('click'); | |
propCounter++; | |
} else { | |
clearInterval(interval); | |
console.log('Done!', propCounter, 'props given!'); | |
} | |
}, 2300); // Just enough time to check the activity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment