-
-
Save gravitinos/369fb8689eb9dcd61e91feb07a574567 to your computer and use it in GitHub Desktop.
Quizlet to CSV file
This 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 characters
| /* | |
| Converts a Quizlet set to a CSV file and downloads it to your computer. | |
| HOW TO USE: | |
| 1. Open your browser's console | |
| 2. Copy all the below code into it, and press enter. | |
| 3. The list will be saved to your downloads as a CSV file! | |
| */ | |
| const terms = document.getElementsByClassName('SetPageTerms-term'); | |
| const csv = [`"term","definition"`]; | |
| Array.from(terms).forEach((term) => { | |
| const word = term.querySelector('.SetPageTerm-wordText').textContent.replace(/[\n\r]+/g, '/'); | |
| const def = term.querySelector('.SetPageTerm-definitionText').textContent.replace(/[\n\r]+/g, '/'); | |
| csv.push(`"${word}","${def}"`); | |
| }); | |
| var blob1 = new Blob([csv.join('\n')], { type: "text/plain;charset=utf-8" }); | |
| var url = window.URL || window.webkitURL; | |
| link = url.createObjectURL(blob1); | |
| var a = document.createElement("a"); | |
| a.download = `${document.querySelector('.SetPage-setTitle').textContent}.csv`; | |
| a.href = link; | |
| document.body.appendChild(a); | |
| a.click(); | |
| document.body.removeChild(a); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yooo, useful fr? i hate quizlet so probs will never use 💀