Created
April 14, 2021 02:44
-
-
Save PalumboN/9693da9f2b796ea957ba7cac93b064df to your computer and use it in GitHub Desktop.
Obtener un csv de los commits una tarea de classroom
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
// Ir a la pantalla de la tarea de classroom. | |
// Pegar esto en una consola | |
toCsv = (dom) => Array.from(dom.children).map(child => child.innerText.replace(' commits', '')).join(',') | |
downloadCSV = () => { | |
repos = Array.from($('.flex-content-around')).map(toCsv).join('\n') | |
name = $('.flex-auto')[1].innerText.split('\n')[0] | |
url = URL.createObjectURL(new Blob([repos], { type: "text" })) | |
link = document.createElement('a') | |
document.body.appendChild(link) | |
link.href = url | |
link.download = `${name}.csv` | |
link.click() | |
} | |
downloadCSV() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment