Skip to content

sonofhypnos/fatebook.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fatebook.el

fatebook.el is an Emacs plugin to create and upload predictions to Fatebook. Usage:

Installation

Dependencies

Fatebook requires the request package. If you don't have it already installed, install it through the instructions found here.

Installing fatebook.el

  • With use-package and straight.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:
  1. Clone the repository:
git clone https://github.com/sonofhypnos/fatebook.el.git
  1. Add the directory to your load-path. In your .emacs or init.el, add:
(add-to-list 'load-path "/path/to/fatebook.el")

Replace "/path/to/fatebook.el" with the actual path to the directory.

  1. Load the package:
(require 'fatebook)

Storing your api-keys

TLDR:

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.

Long version

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.

Configuration

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.

Reporting Bugs

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.

About

An Emacs package to create predictions on Fatebook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published