Skip to content

Instantly share code, notes, and snippets.

@PalumboN
Created April 14, 2021 02:44
Show Gist options
  • Save PalumboN/9693da9f2b796ea957ba7cac93b064df to your computer and use it in GitHub Desktop.
Save PalumboN/9693da9f2b796ea957ba7cac93b064df to your computer and use it in GitHub Desktop.
Obtener un csv de los commits una tarea de classroom
// 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