Jeremy Sands

Res publica non dominetur

How to create your own custom auto-delivered newspaper every day

I had an itch for some time to create a system that would give the area's daily news at a glance, including comics. I finally scratched that itch. Here is the result, in case anybody else has such a desire. Required software:


net-mail/mpack
Homepage: ftp://ftp.andrew.cmu.edu/pub/mpack/
Description: Command-line MIME encoding and decoding utilities

 

app-text/poppler
Homepage: https://poppler.freedesktop.org/
Description: PDF rendering library based on the xpdf-3.0 code base

 

media-gfx/imagemagick
Homepage: http://www.imagemagick.org/
Description: A collection of tools and libraries for many image formats

 

app-text/qpdf
Homepage: http://qpdf.sourceforge.net/
Description: Command-line tool for structural, content-preserving transformation of PDF files

 

And lastly Dosage, a project on GitHub specifically to download web comics. Think of it as JDownloader2 or Youtube-dl ... but specifically for web comics. The easiest way to install this is with pip:

 

dev-python/pip
Homepage: https://pip.pypa.io/ https://pypi.python.org/pypi/pip/ https://github.com/pypa/pip/
Description: Installs python packages -- replacement for easy_install

 

... Using the following command ...

 

pip install --user git+https://github.com/webcomics/dosage

 

This will install dosage (at least for me on Gentoo) to ~/.local/bin/. Invoking dosage --list will display the prodigious number of comics dosage can automatically download. So with the tools in place, here's a very crude script to get the job done. Please read the header of the script, it explains quite a lot. But the end result is that I receive delivered via email a daily comic and newspaper digest to my Kindle. It will be trivial to expand this to include actual news articles and more via RSS feeds and other pdf command line tools, but given that the quality of print journalism is so low that I no longer read virtually anything other than a glance at local headlines, I don't have much motivation to flush that out at this time. Note this requires your system mailer to be valid, but it is trivial to have your system mailer hook into and use your GMail account. (Google it!) newspaper-gen.sh (TXT file link)

Comment

*