Skip to content

Instantly share code, notes, and snippets.

@ecasilla
Created May 14, 2016 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecasilla/0a70c16518aaed50a534bfa2bce750b0 to your computer and use it in GitHub Desktop.
Save ecasilla/0a70c16518aaed50a534bfa2bce750b0 to your computer and use it in GitHub Desktop.
Extract Github Issues Lables
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/ecasilla/github-labelmaker !
var labels = [].slice.call(document.querySelectorAll(".label-link"))
.map(function(ele) {
return {
name: ele.textContent.trim(),
color: ele.getAttribute("style")
.replace("background-color:", "")
.replace(/color:.*/,"")
.trim()
.replace(/^#/, "")
.replace(/;$/, "")
.trim(),
}
});
console.log(JSON.stringify(labels, null, 2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment