diff options
author | Colin Okay <colin@cicadas.surf> | 2022-07-10 08:04:50 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-07-10 08:04:50 -0500 |
commit | 0e84cca4d2b757ade115f4a0aa849ff19a5af82b (patch) | |
tree | 6521cc7cd774b4158a323121ce26c7c54ced4bb6 | |
parent | ca88b751e9bf683689acc59c11f38421dee1f026 (diff) |
[add] auth section to the wf config
-rw-r--r-- | init-el.org | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/init-el.org b/init-el.org index 4d62fff..20d0d9a 100644 --- a/init-el.org +++ b/init-el.org @@ -1483,21 +1483,38 @@ Writefreely is a federated blogging service. The [[https://github.com/dangom/wri package lets you publish to writefreely blogs from the comfort of emacs. -#+name: writefreely-config -#+begin_src elisp :noweb no-export -(package-install 'writefreely) -(require 'writefreely) +*** Prereqs -(setq writefreely-instance-url "https://read.cicadas.surf/" - writefreely-instance-api-endpoint "https://read.cicadas.surf/api" - writefreely-auth-token (read-file-into-string "~/.cicadas-wf.token")) +First, you need to get an auth token. The following will dump one to a json document. +#+begin_src shell +curl "https://read.cicadas.surf/api/auth/login" \ + -H "Content-Type: application/json" -X POST \ + -d '{"alias": "your-user-name", "pass": "your-pw"}' > wf-token.json #+end_src -#+RESULTS: writefreely-config -: a3ad2101-4c09-4c41-4520-9079f6bd346b +Next, open that json document and cop the value of the "access_token" +field into a file called =~/.cicadas-wf.token=. When you do, don't +keep the string quoted - leave it unquoted in that .token file. + +*** Writefreely Config + #+name: writefreely-config + #+begin_src elisp :noweb no-export + (package-install 'writefreely) + (require 'writefreely) + + (setq writefreely-instance-url "https://read.cicadas.surf/" + writefreely-instance-api-endpoint "https://read.cicadas.surf/api" + writefreely-auth-token (read-file-into-string "~/.cicadas-wf.token")) + + + + #+end_src + + #+RESULTS: writefreely-config + : a3ad2101-4c09-4c41-4520-9079f6bd346b * Software Development |