Created
May 30, 2015 14:16
-
-
Save m/f27ae57113e34392c6d5 to your computer and use it in GitHub Desktop.
Auto-unsubscribe on Unroll.me
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
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this! Worked perfectly.