Last active
August 21, 2019 12:12
-
-
Save arjunmayilvaganan/97e29d1531bac37a2a38661b024a7a2c to your computer and use it in GitHub Desktop.
Script to unsubscribe from repos belonging only to a particular organisation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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