Skip to content

Instantly share code, notes, and snippets.

@reesericci
Created April 22, 2026 18:23
Show Gist options
  • Select an option

  • Save reesericci/b5aa288c4db0cbdac9f45585a4997220 to your computer and use it in GitHub Desktop.

Select an option

Save reesericci/b5aa288c4db0cbdac9f45585a4997220 to your computer and use it in GitHub Desktop.
Substack to OPML (run in JS console from reads page)
(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