Last active
May 2, 2019 20:29
-
-
Save wsrast/bcb6fcf7eb24f991725308b39edd60ba to your computer and use it in GitHub Desktop.
Bitbucket web page scraper for repositories
This file contains hidden or 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
JSON.stringify(Array.from(document.querySelectorAll('[data-repository-id]')).map(aTag => { | |
const href = aTag.getAttribute('href'); | |
let projName = href.match(/\/projects\/(.+)\/repos/)[1].toLowerCase(); | |
let repoName = href.match(/\/repos\/(.+)\/browse/)[1]; | |
repoName = repoName.replace(' ', '-'); | |
const templ = `https://${location.host}/scm/${projName}/${repoName}.git`; | |
return { | |
href, | |
name: aTag.innerText, | |
clone: templ | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment