-
-
Save roeeyn/f768f678ec2ae30e629e1f6ccd1ae254 to your computer and use it in GitHub Desktop.
Unwatch multiple repositories at once in GiHub
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
/* USAGE | |
Go to https://github.com/watching | |
Paste this function in the console | |
e.g. unwatchRepos("rails|node|go") | |
That unwatches repos containing rails, node or go in the repo link. | |
*/ | |
var unwatchRepos = (pattern) => { | |
var list = document.getElementsByClassName('repo-list')[0] | |
var rows = list.getElementsByClassName('js-subscription-row') | |
for(var i = 0; i < rows.length; i++) { | |
var row = rows[i] | |
var link = row.getElementsByTagName('a')[0] | |
if(RegExp(pattern).test(link.href)) { | |
row.getElementsByClassName('btn-sm')[0].click() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment