We read habr, xkcd and rss on kindle
With the advent of the e-book, I wanted to get a bundle of news on it every day to read it on the way to work. It would seem that there are already tools: take and use. But, as always, the difficulties are in the details:
Disadvantages: simplicity. Well, you can’t explain to these utilities that comments are also interesting to read and should be included in the article. There is also no periodic collection of articles.
Disadvantages: for him to do exactly what is needed, refinement with a rasp is required. About this and the article.
When you click on it, the post is added to the feed and in the morning, before I leave home, caliber will download articles to the device on the crown.
Depending on your preferences, you can either configure the periodic generation of books in caliber, or do this from the command line:
- Articles must be scheduled
- Only new articles should be sent
- Different sites need different settings.
- Pictures are not only in jpeg
- For xkcd, you need to be able to render latex
- There are many articles on the Habré, and only selected
Existing solutions
Send to kindle and Push to kindle
Pluses: simplicity. A one-click add-on to the browser. A second click sends the page to the reader.Disadvantages: simplicity. Well, you can’t explain to these utilities that comments are also interesting to read and should be included in the article. There is also no periodic collection of articles.
Caliber
Advantages: powerful configurable open tool. You can make him do exactly what he needs.Disadvantages: for him to do exactly what is needed, refinement with a rasp is required. About this and the article.
Requirements
- Once a day, you need to collect the accumulated articles and send to the reader.
- In many rss feeds there are not many entries, so the option with a separate book for each feed was not considered. Moreover, kindle found a convenient two-level table of contents.
- Modern readers do not only support jpeg. Black and white png comics do not need to be pinched, especially you do not need to replace the transparent background with black: rectangles are conceptual and stylish, but not quite what I want to consider every morning.
- I need the opportunity to mark the articles that I want to read on the book. They and only they need to be transferred.
- It is advisable to download articles immediately before sending, so that more comments accumulate for them.
- Latex formulas need to be rendered in png, not drawn using JavaScript
Decision
Conversion
To download and convert articles, use the command-line version of the caliber . You must use a version of at least 0.8.51, since it supports the --mobi-keep-original-images option . Unfortunately, converting to mobi is not the only place where images are forcibly saved to jpeg. We need to wean RecursiveFetcher, loading news feeds, from this bad habit. Another problem is that the configuration unit in caliber is the entire book. I had to have different conversion settings for different feeds. This is solved by creating a new FeedFetchSettings entity and writing a special MultiFeedRecipe configured by these settings. All these modifications can be found on the github.. Also, MultiFeedRecipe can remember which articles it has already downloaded, and the next time it starts, it skips them.latex
I love reading What If , but the author uses a JavaScript library to draw formulas, which, of course, does not work in the reader. Therefore, instead of it, I use the texvc utility from the mediawiki-math-texvc package that generates html for simple formulas and pictures for complex ones. Therefore, for What If export to work, you need to install this library.Articles from Habr
Pumping out all the habrahabr to the reader is not what I would like. I need to put off separate long articles, so that later, when there is a mood, I read them. To do this, I installed the simplest script on my hosting that gives rss feed on a GET request and adds links to it on a POST request. The number of results is limited, old records are thrown away. There is no authorization, but I won’t say the address of the script either. Those who wish can install it themselves, after renaming it. Greasemonkey userscript is attached to the server script , it works in firefox and opera and adds a 2kindle button to posts :When you click on it, the post is added to the feed and in the morning, before I leave home, caliber will download articles to the device on the crown.
Delivery to the reader
There is a caliber-smtp utility in caliber, which I use to send finished books to kindle. And amazon, having received this letter, sends the file via WiFi to the reader.Customization
Take example.recipe , copy to a secluded place. Configure restrictions on the number and age of articles, as well as the path to the file in which to save the list of downloaded articles. The feed_settings property lists the settings for each article source. You can specify extra settings. And the feeds property lists the names of the sources and addresses of the feeds in the order in which they should be in the table of contents.Depending on your preferences, you can either configure the periodic generation of books in caliber, or do this from the command line:
ebook-convert example.recipe news.mobi --no-inline-toc --mobi-keep-original-images --output-profile=kindle