Skip to content

Instantly share code, notes, and snippets.

@endophage
Created August 13, 2018 16:29
Show Gist options
  • Save endophage/391d0998c795332bd1187573e13a3ed5 to your computer and use it in GitHub Desktop.
Save endophage/391d0998c795332bd1187573e13a3ed5 to your computer and use it in GitHub Desktop.
Unwatch org in GitHub
// From https://github.com/isaacs/github/issues/641#issuecomment-328716343
// 1. Go to https://github.com/watching
// 2. Open JS console and paste in function
// 3. Call function with desired org you want to unwatch.
function unwatchOrgRepos(orgName) {
var repoItems = document.querySelectorAll(".repo-list > li")
repoItems.forEach(function (item) {
var repoOrgElement = item.querySelector(".repo-name").previousElementSibling;
var repoOrgName = repoOrgElement.innerText;
if (repoOrgName === orgName) {
var unwatchButton = item.querySelector(".js-unsubscribe-form > button");
unwatchButton.click();
var itemName = repoOrgElement.parentElement.innerText;
console.log("Unwatched " + itemName);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment