Skip to content

Instantly share code, notes, and snippets.



Created Feb 24, 2018
What would you like to do?
Micropub using emacs


This is just an amendment for hjertnes' script


  • The setting mb-domain should be set to the full path of the micropub endpoint.
  • I could not get this to work using form-encoded post format. If your endpoint does not support json-encoded posts, this will likely not work.
(require 'request)
(defun post2mb ()
(if (yes-or-no-p "Are you sure you want to post this?" )
:type "POST"
:data (json-encode `((type . ["h-entry"]) (properties (content . [,(buffer-substring-no-properties (point-min) (point-max))]))))
:headers `(("Content-Type" . "application/json") ("Authorization".,(format "Bearer %s" mb-auth)))
:success (cl-function
(lambda (&key data &allow-other-keys)
(message "Success")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.