Oh, hi. I'm a little pi bot that prints out the New York Times Mini Crossword of the day for your analog xwordin' delight.
My creation was inspired by the Vomit Comic Robot.
- Raspberry Pi (any model should work, I used a 3 Model B)
- Adafruit Mini Thermal Receipt Printer Starter Pack
- micro SD card
- 5V 2A Micro USB AC Charger Power Supply Adapter
- ethernet cable
- basic Pi case (dependent on model, I used this one)
For button and light functionality
- LED
- push button
- female-to-male jumper wires x4
- resistor
- solderless breadboard
- Flash a Raspberry Pi OS image (the full version, not lite) to micro SD card with Etcher
- Enable SSH on the rpi by adding a blank
ssh
file in the/boot
directory of the SD card - Connect the rpi power supply and insert the SD card
- Connect ethernet cable between the rpi and router
- SSH into the rpi
- Follow Adafruit’s tutorial to connect and configure the rpi to the printer
Wire up the LED, button, and resistor as follows:
- GPIO pin diagram
- PiHut tutorial explains the concepts behind wiring up the breadboard
Requirements: npm, Node v14+, Python 3.7+ (pre-installed on newer rpi OS images)
- SSH into the rpi and clone this repo
- Run
./install.sh
(note: the first sections of this install script overlaps with the printer tutorial steps from above; can skip. Just make sure thePython-Thermal-Printer/Adafruit_Thermal.py
file is copied within the nyt-mini-bot repo) - Run
./xword-printer.py
- Press the button!
Using Puppeteer, this Node script navigates to the NYT Mini page, takes a screenshot of the crossword board, and saves the date/clues to a text file.
To test in isolation:
- If outside of the pi, remove
executablePath: 'chromium-browser',
from thepuppeteer.launch
line - Run
npm run start
This Python script executes the xword-fetcher script as a subprocess, connects to the printer using the Adafruit Python Thermal Printer library, and prints out the puzzle retrieved by xword-fetcher.
TODO:
- Trigger xword-printer.py script on rpi boot
- Get WiFi working on rpi