|
|
7 anni fa | |
|---|---|---|
| bookworm | 7 anni fa | |
| docs | 7 anni fa | |
| front | 7 anni fa | |
| screenshots | 10 anni fa | |
| services | 7 anni fa | |
| .gitignore | 7 anni fa | |
| README.md | 7 anni fa | |
| nginx_file | 8 anni fa | |
| requirements.txt | 8 anni fa | |
| setup.py | 7 anni fa |
To remove the initial roundtrip when searching for books, I keep a cache in a
local sqlite database.
To populate this cache, there's an API endpoint (books/batch_update) that triggers each bot's LIST command, at #ebooks
sudo cp services/bookworm@.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start bookworm@ircclient.service
sudo systemctl start bookworm@file_fetcher.service
sudo systemctl start bookworm@unpacker.service
sudo systemctl start bookworm@web.service
In charge of processing received commands and sending them via IRC.
Will forward details from DCC to the file fetcher via redis.
In charge of fetching files specified via DCC.
Will store the file in S3 and notify file details to the unpacker.
In charge of taking a file (as provided from IRC), unpacking it and, if necessary, converting it to mobi.
/books/status)/book/search?terms=.../book/fetch/--
The kindle has a very basic webbrowser (I believe it renders up to HTML4, CSS2.1), which can be used to download (available) books directly.
At the moment I re-route at nginx based on user agent
To test, you can use dillo which has a set of features similar to the kindle's web browser.
if ($http_user_agent ~* "armv7l") {
rewrite ^/(.*)$ /books/kindle;
}
For now, you can control this via HTTP.
$ # populate the index, only once in a while for new books
$ http POST localhost:5000/books/batch_update
$ # search the book that you want
$ http localhost:5000/book/search terms=='brandon sanderson'
$ # download book, will be placed in the S3 bucket
$ http POST localhost:5000/book/fetch bot=Pondering42 book="some-book-from the
index"