Created
March 18, 2023 23:47
-
-
Save marcinantkiewicz/03e6691136da206f58c361ffb326477e to your computer and use it in GitHub Desktop.
List GitHub repos via browser console
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
// go to https://github.com/orgs/ORGNAME/repositories, open JS console | |
// run the below. Once done, extract with "JSON.parse(sessionStorage.repolist).forEach((e)=>{console.log(e)})" | |
// | |
// The following will covert from https to ssh endpoint link | |
// %s/$/.git/ | |
// %s/https:\/\//git@/ | |
// %s/\.com\//\.com:/ | |
// | |
extract(); | |
function extract(){ | |
list = document.querySelectorAll('[itemprop="name codeRepository"]'); | |
if('repolist' in sessionStorage){ | |
data = JSON.parse(sessionStorage.repolist); | |
console.log(`Found ${data.length} items`); | |
} | |
else { | |
data = [] | |
console.log("Starting"); | |
} | |
list.forEach((e)=>{data.push(e.href)}); | |
console.log(`Saved ${data.length} items`); | |
sessionStorage.setItem('repolist',JSON.stringify(data)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment