Skip to content

Instantly share code, notes, and snippets.

@shombando
shombando / gen-epub.ts
Last active September 15, 2023 17:11 — forked from kebot/gen-epub.ts
Generate Epub for Omnivore Articles
// get a list of articles based on search endpoint
import { gql, GraphQLClient } from 'npm:graphql-request'
import sanitizeHtml from 'npm:sanitize-html'
import epub, { Chapter } from 'npm:epub-gen-memory'
const OMNIVORE_API_KEY = ''
const OMNIVORE_ENDPOINT = 'https://api-prod.omnivore.app/api/graphql'
const graphQLClient = new GraphQLClient(OMNIVORE_ENDPOINT, {
headers: {