Skip to content

Instantly share code, notes, and snippets.

@jheidt
Created December 19, 2019 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jheidt/d9c9927c6cd6d89fc1fd4b136b1a8b08 to your computer and use it in GitHub Desktop.
Save jheidt/d9c9927c6cd6d89fc1fd4b136b1a8b08 to your computer and use it in GitHub Desktop.
Automatically claim twitch community points. Run in browser console.
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