[[https://melpa.org/#/writefreely][file:https://melpa.org/packages/writefreely-badge.svg]] [[https://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]
This small library allows you to publish and update your Org-mode files as posts to any instance of the federated blogging platform [[https://writefreely.org][write freely]]. No account nor registration is required for anonymous posts in the platform.
View it in action:
[[writefreely-el-demo.gif]]
An example post generated with this library can be found [[https://write.as/dani/an-emacs-library-for-frictionless-blogging][here]]. The source org file can be found under example-post.org in the root of this repository.
This project is available on Melpa. To use it:
(use-package writefreely :after org :ensure t ;; Authentification token, if wanted. ;; Alternatively (setq writefreely-auth-token "00000000-0000-0000-0000-000000000000") :config (load-library "writefreely-auth-token.el.gpg"))
This package now depends on [[https://github.com/larstvei/ox-gfm][ox-gfm]] to get the code export done properly.
To configure your writefreely instance, simply customise the variables =writefreely-instance-url= and, most importanly, =writefreely-instance-api-endpoint=. Per default they point to [[https://write.as][write.as]].
All posts will be created anonymously, unless you set the variable =writefreely-auth-token= is set to a valid user access token. For more information about generating access tokens visit https://developers.write.as/docs/api/#authentication.
When authenticated, you may choose to submit posts anonymously or to one of your collections.
If using the write.as, instance, for example, copy and paste the following into your shell, changing the username and password to those of your account:
curl "https://write.as/api/auth/login" \ -H "Content-Type: application/json" \ -X POST \ -d '{"alias": "user", "pass": "12345"}'