Skip to content

Instantly share code, notes, and snippets.

@said-and-done
Last active October 18, 2019 11:32
Show Gist options
  • Save said-and-done/07b3f2fe1d9d4947691dbc1a29bf056d to your computer and use it in GitHub Desktop.
Save said-and-done/07b3f2fe1d9d4947691dbc1a29bf056d to your computer and use it in GitHub Desktop.
let subscribers = ['[email protected]', '[email protected]'];
let count = subscribers.length;
let current = 0;
let URL = 'https://newsletter.services.tv2.dk/api/unsubscribe';
let unsub = (mail) => {
$.post(URL, {
"email": mail,
"subscribers": ["opx-moneytalks"],
},
(resp) => {
console.log('unsubscribed: %s (%s/%s)', mail, ++current, count);
});
};
(function f() {
if (!subscribers.length)
return;
unsub(subscribers.pop());
setTimeout(f, 200);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment