Created
December 19, 2019 01:12
-
-
Save jheidt/d9c9927c6cd6d89fc1fd4b136b1a8b08 to your computer and use it in GitHub Desktop.
Automatically claim twitch community points. Run in browser console.
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
if( !!this['claimIntervalId'] && this['claimIntervalId'] > 0) { | |
console.log(`clearing interval (id = ${ this['claimIntervalId'] })`); | |
window.clearInterval(this['claimIntervalId']); | |
} | |
claimIntervalId = window.setInterval( () => { | |
const claim = document.querySelector('div.claimable-bonus__icon'); | |
if(null !== claim) { | |
console.info('claimed reward!'); | |
try { claim.parentElement.parentElement.click(); } | |
catch(e) { console.error(e); } | |
} | |
}, 2500); | |
this['claimIntervalId'] = claimIntervalId; | |
console.log(`setup claim check interval (id = ${ claimIntervalId })`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment