RSS feed to a dot matrix printer

This little project has turned out as fun as it’s been noisy (rather). Not much to showcase, but I cannot find any reason to get rid of it either.

A bash script to turn an RSS news feed in escape-formatted dot-matrix printer text. Or: a questionable waste of time, continuous-form paper, and ink ribbon.

Description

Quoting the video caption:

Those escape sequences that look like line noise are Epson ESC/P control codes, to which my printer (a Citizen 120D+) is partially compliant.

Someday, somehow, I’ll turn all those sed calls in a nice awk script. Apart from syntax cleanliness, a big issue is reverse ordering the title-desc-pubDate tuples so the newest headlines are printed last, both in the zero-time print and the updates. Feel free to edit.

This is definitely not the right way to do it and catching all the bad shell scripting practices may be a interesting code review exercise, now. Anyway, this mess seems to be still working (see the comments on the YouTube video above).

More descriptive comments would have helped, particularly for all the escape codes (all those \\e\\x-something), which are in the printers own ESC/P dialect (from its original spiral-bound manual, of which I only had the French version - relevant Simpsons quote). Nowadays I do not have this printer at hand (and I vowed to myself I won’t be hoarding others) therefore further testing is out of the question :)

Keep in mind that the argument provided to lpr -P, variable cups_raw_queue (e.g. lpt-raw) should match the name of a local CUPS printer set as a raw queue on the parallel port (or adapter) device. This is a feature which is planned to be deprecated, as of March 2018 - see cups issue #5271.

Tags: