Last active
          June 8, 2025 14:14 
        
      - 
            
      
        
      
    Star
      
          
          (155)
      
  
You must be signed in to star a gist 
- 
              
      
        
      
    Fork
      
          
          (33)
      
  
You must be signed in to fork a gist 
- 
      
- 
        Save MoOx/93c2853fee760f42d97f to your computer and use it in GitHub Desktop. 
Revisions
- 
        MoOx revised this gist May 6, 2015 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,15 @@ var labels = []; .forEach(function(element) { labels.push({ name: element.textContent.trim(), // using style.backgroundColor might returns "rgb(...)" color: element.getAttribute("style") .replace("background-color:", "") .replace(/color:.*/,"") .trim() // github wants hex code only without # or ; .replace(/^#/, "") .replace(/;$/, "") .trim(), }) }) console.log(JSON.stringify(labels, null, 2)) 
- 
        MoOx revised this gist May 6, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // go on you labels pages // 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/popomore/github-labels ! var labels = []; [].slice.call(document.querySelectorAll(".label-link")) 
- 
        MoOx created this gist May 6, 2015 .There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ // go on you labels pages // eg https://github.com/cssnext/cssnext/labels // paste this script in your console // copy the output and enjoy ! var labels = []; [].slice.call(document.querySelectorAll(".label-link")) .forEach(function(element) { labels.push({ name: element.textContent.trim(), color: element.getAttribute("style").replace("background-color:", "").replace(/color:.*/,"").trim(), }) }) console.log(JSON.stringify(labels, null, 2))