Skip to content

Instantly share code, notes, and snippets.

@eric-vader
Forked from offirgolan/unwatch-gh-org.js
Last active January 23, 2022 16:00
Show Gist options
  • Save eric-vader/a3b0caada70fc30f00fa816694962498 to your computer and use it in GitHub Desktop.
Save eric-vader/a3b0caada70fc30f00fa816694962498 to your computer and use it in GitHub Desktop.
Unwatch All Org Repos
// Navigate to https://github.com/watching and then run:
(function() {
let qx = $x;
let unwatch = function(org, notificationType) {
let nodes = document.querySelectorAll('.Box-row');
let rows = [ ...nodes ];
let orgRows = rows.filter(e => e.innerText.startsWith(`${org}/`));
let orgUnsubButtons = orgRows.map(row => row.querySelector(`button.SelectMenu-item[value="${notificationType}"]`));
orgUnsubButtons.forEach(button => console.log(button.click()));
setTimeout(function() {
}, 1000);
};
let org = 'nus-cs3203'; // <--- change ORG to desired organization, and repeat for all pages
let notificationType = 'included'; // 'included' = participating and @mentions, 'subscribed' = all activity, 'ignore' = ignore
unwatch(org, notificationType);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment