Created
April 22, 2026 18:23
-
-
Save reesericci/b5aa288c4db0cbdac9f45585a4997220 to your computer and use it in GitHub Desktop.
Substack to OPML (run in JS console from reads page)
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
| (async () => { | |
| const handle = await window.showSaveFilePicker({ | |
| suggestedName: 'substack.opml', | |
| types: [{ description: 'OPML File', accept: { 'text/x-opml': ['.opml'] } }], | |
| }); | |
| const writable = await handle.createWritable(); | |
| let opml = await (await import("https://esm.sh/opml-generator")).default | |
| let q = Array.from(document.querySelector("#entry > div.reader-nav-root.reader2-font-base > div.reader-nav-page > div > div > div > div:nth-child(3) > div.pencraft.pc-display-flex.pc-flexDirection-column.pc-paddingBottom-20.pc-reset.flex-fill-uYLRqz > div").children) | |
| await writable.write(opml({ title: "Substack" }, | |
| q.map((el) => | |
| new Object({ xmlUrl: el.href + "/feed", title: el.innerText.split("\n")[0]}) | |
| ) | |
| )) | |
| await writable.close(); | |
| })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment