Skip to content

Instantly share code, notes, and snippets.

@marcinantkiewicz
Created March 18, 2023 23:47
Show Gist options
  • Save marcinantkiewicz/03e6691136da206f58c361ffb326477e to your computer and use it in GitHub Desktop.
Save marcinantkiewicz/03e6691136da206f58c361ffb326477e to your computer and use it in GitHub Desktop.
List GitHub repos via browser console
// 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