Skip to content

Instantly share code, notes, and snippets.

@rafi
Created February 23, 2020 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafi/477a7ff9113ab035056d7dbdfae98ca7 to your computer and use it in GitHub Desktop.
Save rafi/477a7ff9113ab035056d7dbdfae98ca7 to your computer and use it in GitHub Desktop.
Unwatch all repos of organization
// Browse to https://github.com/watching and run in console:
(function() {
let qx = $x;
let unwatch = function(org) {
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.select-menu-item[value="included"]'));
orgUnsubButtons.forEach(button => console.log(button.click()));
setTimeout(function() {
qx("//a[text()='Next']")[0].click();
}, 1000);
};
let org = 'ORG'; // <--- change ORG to desired organization
unwatch(org);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment