TwitterMatrixTicker Dot Matrix Tweet Printer

 At the beginning of this month, at the Silicon Valley Flea Market, I managed to pick up an old Star NP-10 dot matrix printer in relatively good shape for $5.  Due to other circumstances, I've also found myself in possession of just shy of two cases of tractor feed paper.  I figured I would need to find a reasonable application for these two wonderful events.
Demo Video:
 I present... the TwitterMatrixTicker!  I currently have it configured to watch for any tweets mentioning me (@KWF), and then having it print each tweet line by line on this great piece of printer history, so feel free to send me tweets and enjoy the thought of them interrupting my evening as they print out on this ridiculous loud monstrosity.
The hardware is relatively straight forward; a BeagleBone (Thanks to TI for giving me one for free!) uses Twitter's API to search for @KWF tweets, then parses out the usernames and text and sends it to the Star NP-10 over a USB-to-Centronics adapter.  I would love to have set up a webcam live-streaming the twitter stream streaming onto my floor, but I'm afraid that local bandwidth limitations make that prohibitive.

I currently have it just printing flat ASCII, but these printers can usually do quick a bit of formatting on their own.  I haven't been able to find a manual for this specific printer, but the Epson FX-80 manual should give you a good idea of the method; while printing text, send "ESCape,command-code" sequences in-line to place the printer into different modes (bold, wide font, underline, higher resolution).  The higher resolution, or "Near Letter Quality" mode is a good one to know, because dot matrix printers literally print via an array of metal pins striking a ribbon to the paper.  After a single pass, the font is... "dotty," and doesn't look very good.  By putting the printer into NLQ mode, it takes a second printing pass slightly off-set from the first, to try and smooth out the final result.
This was all printed in NLQ mode.  Considering that this printer is decades old, and that I didn't have to replace the ink cartridge in it (other than rolling out the next foot of ribbon), I have to say I'm quite impressed with this printer.  Modern printers really are terrible...

Like always, I give you the source code for the shell script I wrote for this:

Just change the user name on the first line, the output file to your printer device, and the timing limits if you want to pound Twitter more often than every 15 minutes, which I have it set up for.  This would probably lend itself well as a cron script, but I felt like writing it as a busy loop to make the dynamic API request intervals easier.

Popular Posts