43 lines
1.2 KiB
Markdown
43 lines
1.2 KiB
Markdown
# serial
|
|
|
|
> a book serializer
|
|
|
|
this is the worst thingie i can imagine that sends you an email at a scheduled
|
|
interval containing a snippet of a book, length of your choosing.
|
|
|
|
## requirements
|
|
|
|
- recutils
|
|
- awk
|
|
- postfix: configuring postfix (or some other mail transfer agent) is up to you!
|
|
i successfully did it after a lot of trial and error. see: `/doc/postfix.txt`
|
|
- jq
|
|
- fzf (optional)
|
|
- just (optional)
|
|
|
|
## usage
|
|
|
|
1. update the recepient's email address in `justfile`
|
|
|
|
2. put plain text ebooks in `/src`.
|
|
(check out https://www.gutenberg.org/)
|
|
|
|
3. create a new entry for each new book in `config.rec`
|
|
(see `config.rec` for details)
|
|
|
|
4. either run `just process` every day, or set up a cron job to run it
|
|
(https://crontab.guru/#12_*_*_*_*)
|
|
|
|
## details
|
|
|
|
All variables and values mentioned below exist in each record of `config.rec`
|
|
|
|
1. Iterate over the records in config.rec. If today is not present in `delivery`, continue.
|
|
|
|
2. Iterate over paragraphs (sep = '\n\n') starting with paragraph number
|
|
`progress` and ending when the running word count exceeds `WPM * minutes`.
|
|
|
|
3. Pipe those paragraphs to postfix mail
|
|
|
|
4. Increment `iter` and update `progress` to be the final paragraph number (plus one)
|