-
-
Save wo0dyn/d915d784b1bc9b813052644aa7e988da to your computer and use it in GitHub Desktop.
Export GitHub labels
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 on you labels pages and paste this script in your console | |
var labels = []; | |
[].slice.call(document.querySelectorAll(".label-link")) | |
.forEach(function(element) { | |
labels.push({ | |
name: element.textContent.trim(), | |
// using style.backgroundColor might returns "rgb(...)" | |
bgcolor: element.getAttribute("style") | |
.replace("background-color:", "") | |
.replace(/color:.*/,"") | |
.trim() | |
.replace(/;$/, ""), | |
color: element.getAttribute("style") | |
.replace(/background-color:[^;]*;/,"") | |
.replace(/color:/,"") | |
.trim() | |
.replace(/;$/, ""), | |
}) | |
}) | |
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