Skip to content

Instantly share code, notes, and snippets.

@stgarf
Forked from offirgolan/unwatch-gh-org.js
Last active April 1, 2019 19:25
Show Gist options
  • Save stgarf/aaa94b9a03e57cf4856e064adee2dbbc to your computer and use it in GitHub Desktop.
Save stgarf/aaa94b9a03e57cf4856e064adee2dbbc to your computer and use it in GitHub Desktop.
Unwatch All Org Repos
// Navigate to https://github.com/watching and then run:
// Taken from: https://stackoverflow.com/questions/11043374/how-to-unwatch-multiple-repos-easily-on-github
Array.prototype
.slice.apply(document.querySelectorAll('.Box-row'))
.forEach(el => {
const org = el.querySelector('a[href^="/YOUR_ORG"]');
if (org) el.querySelector('button').click()
});
var xpath = "//a[text()='Next']";
var matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
matchingElement.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment