Skip to content

Instantly share code, notes, and snippets.

@huyby
Last active June 5, 2024 12:32
Show Gist options
  • Save huyby/ff5d84fca7cdfdd5a85bb0576985f390 to your computer and use it in GitHub Desktop.
Save huyby/ff5d84fca7cdfdd5a85bb0576985f390 to your computer and use it in GitHub Desktop.
Github subscription clean up
function unsubscribeAll() {
fetch('https://github.com/notifications/subscriptions?reason=review_requested', {
method: 'POST',
body:new FormData(document.querySelector('#threads-unsubscribe-form')),
})
.then((response) => response.text())
.then((text) => {
document.querySelector('html').innerHTML=text
const subscriptionIds = document.querySelectorAll('input[name^=subscription_ids]');
if (subscriptionIds.length === 25) {
document.querySelectorAll('input[name^=subscription_ids]').forEach((el) => el.checked=true);
setTimeout(unsubscribeAll, 1000);
}
})
}
@huyby
Copy link
Author

huyby commented Jun 5, 2024

Added ?reason=review_requested to only cleanup those subscriptions

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