Skip to content

Instantly share code, notes, and snippets.

@arjunmayilvaganan
Last active August 21, 2019 12:12
Show Gist options
  • Save arjunmayilvaganan/97e29d1531bac37a2a38661b024a7a2c to your computer and use it in GitHub Desktop.
Save arjunmayilvaganan/97e29d1531bac37a2a38661b024a7a2c to your computer and use it in GitHub Desktop.
Script to unsubscribe from repos belonging only to a particular organisation
(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, and repeat for all pages
unwatch(org);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment