Skip to content

Instantly share code, notes, and snippets.

View mig's full-sized avatar

Matthew Swasey mig

  • LivingSocial
  • Washington DC
View GitHub Profile
@m
m / gist:f27ae57113e34392c6d5
Created May 30, 2015 14:16
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 );
}