fatebook.el is an Emacs plugin to create and upload predictions to Fatebook. Usage:
Fatebook requires the request
package. If you don't have it already installed, install it through the instructions found here.
- With
use-package
andstraight.el
:
(use-package fatebook
:straight (fatebook :repo "sonofhypnos/fatebook.el" :host github
:files ("fatebook.el"))
:commands fatebook-create-question)
Put this into packages.el
(package! fatebook
:recipe (:host github
:repo "sonofhypnos/fatebook.el"))
- Manual installation: copy
fatebook.el
to your load-path and then run(require 'fatebook)
. For example:
- Clone the repository:
git clone https://github.com/sonofhypnos/fatebook.el.git
- Add the directory to your
load-path
. In your.emacs
orinit.el
, add:
(add-to-list 'load-path "/path/to/fatebook.el")
Replace "/path/to/fatebook.el"
with the actual path to the directory.
- Load the package:
(require 'fatebook)
You have an existing solution for secrets in Emacs? Set fatebook-api-key-function
in your configuration to your own custom function to retrieve your secret.
Otherwise:
open ~/.authinfo.gpg
with emacs:
emacs ~/.authinfo.gpg
Emacs will prompt you for a password to encrypt the file (you can also use ~/.authinfo
if you don't want to encrypt your secrets (not recommended!)).
Add this line to the file:
machine fatebook.io login defaultUser password $your-api-key
Replace $your-api-key with your api key found under https://fatebook.io/api-setup and leave the remaining fields the same.
For the longer explanation see this section I stole from (ghub)Getting Started:
Please also see (auth)Top for all the gory details about Auth-Source.
The variable auth-sources controls how and where Auth-Source keeps its secrets. The default value is a list of three files: ("
/.authinfo" "/.authinfo.gpg" "~/.netrc"), but to avoid confusion you should make sure that only one of these files exists and then you should also adjust the value of the variable to only ever use that file, for example:
(setq auth-sources '("~/.authinfo"))
In ~/.authinfo secrets are stored in plain text. If you don’t want that, then you should use the encrypted ~/.authinfo.gpg instead:
(setq auth-sources '("~/.authinfo.gpg"))
Auth-Source also supports storing secrets in various external key-chains. See (auth)Top for more information.
The default Auth-Source backends only support storing three values per entry; the "machine", the "login" and the "password".
If you want fatebook.el to be able to find your api key use fatebook.io
for machine, defaultUser
for user and fatebooks api key for password
.
By default, fatebook.el uses org-read-date
to pick a date. If you don't want to load the whole of org for this package, set fatebook-use-org-read-date
to nil in your config or in the customization interface.
If you are having problems make sure you have followed all the steps listed above. If you still have problems run fatebook-create-question
with fatebook-debug
set to t
and include the debug message from the echo-area
in your bug report.