Last active
October 10, 2017 07:33
-
-
Save onionmk2/bece8ea5f5d2ac19df2ec655fe66edd4 to your computer and use it in GitHub Desktop.
save a transcript of KhanAcademy's video
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
| const spans = $("ul[itemprop=transcript] li span[class='']"); | |
| const array = Array.from(spans); | |
| const texts = array.map(t => t.textContent.replace(/\n/, '') + '\n'); | |
| const fileName = $("h1")[0].textContent; | |
| const file = new File(texts, fileName, { | |
| type: "text/plain", | |
| }); | |
| const a = document.createElement("a"); | |
| a.href = URL.createObjectURL(file); | |
| a.download = fileName; | |
| a.click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment