Skip to content

Instantly share code, notes, and snippets.

@m
Created May 30, 2015 14:16
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save m/f27ae57113e34392c6d5 to your computer and use it in GitHub Desktop.
Auto-unsubscribe on Unroll.me
var i = 0;
function unroll_me_unsubscribe() {
// Bail if share modal (indicating free limit reached) is encountered.
if ( jQuery( '#fb-root' ).length > 0 ) { return; }
var unsub_link = jQuery( '.LetterList a.uicon-set-unsubscribe:first' );
if ( unsub_link.length > 0 ) {
document.getElementById( unsub_link.attr( 'id' ) ).click();
if ( i++ < 6000 ) { /* Upper limit in case something goes wrong. */
setTimeout( unroll_me_unsubscribe, 1500 );
}
}
}
unroll_me_unsubscribe();
@mig
Copy link

mig commented Aug 9, 2015

Thank you for this! Worked perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment