Skip to content

Instantly share code, notes, and snippets.

@badri
Created June 10, 2016 01:45
Show Gist options
  • Save badri/39653b4cdc8c396b1fac5ed5e3ab7046 to your computer and use it in GitHub Desktop.
Save badri/39653b4cdc8c396b1fac5ed5e3ab7046 to your computer and use it in GitHub Desktop.
leanpub-preview
(defun leanpub-preview ()
"Generate a preview of your book @ Leanpub."
(interactive)
(request
"https://leanpub.com/<YOUR-BOOK-SLUG>/preview.json" ;; or better yet, get the book slug from the buffer
:type "POST" ;; and construct the URL
:data '(("api_key" . "53cr3t"))
:parser 'json-read
:success (function*
(lambda (&key data &allow-other-keys)
(message "Preview generation queued at leanpub.com."))))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment