Skip to content

Instantly share code, notes, and snippets.

@lukaswoj
Last active January 19, 2017 11:11
Show Gist options
  • Select an option

  • Save lukaswoj/49e8f5411367192a5f5c37ada9e92bd2 to your computer and use it in GitHub Desktop.

Select an option

Save lukaswoj/49e8f5411367192a5f5c37ada9e92bd2 to your computer and use it in GitHub Desktop.
With this gist you can go over all subpages of repository list in bitbucket and extract list of them all
// 1. Go to https://bitbucket.org/dashboard/repositories?page=1
// launch below two lines in developer console
var cssSelector = '#repositories-pjax > div > section > table > tbody > tr > td.repo-list--repo-column > div > a';
var bbRepositories = [];
// launch below statement once on 1st page, then go to 2nd page and launch it again and until you go through all pages
$(cssSelector).each(
function(index, el) {
bbRepositories.push(el.attributes.href.nodeValue.split('/')[2]);
}
);
// finally, launch below to echo all the repos gathered to browser console from where you can copy it to clipboard and use anywhere
bbRepositories.join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment