Skip to content

Raspberry Pi bot that prints out the New York Times Daily Mini Crossword on a receipt.

Notifications You must be signed in to change notification settings

anyu/nyt-mini-bot

Repository files navigation

NYT Mini Bot

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.

NYT Mini Bot image NYT Mini Bot image NYT Mini Bot demo gif

Make me at home!

Hardware

For button and light functionality

  • LED
  • push button
  • female-to-male jumper wires x4
  • resistor
  • solderless breadboard

materials

Headless Raspberry Pi + thermal printer setup

  1. Flash a Raspberry Pi OS image (the full version, not lite) to micro SD card with Etcher
  2. Enable SSH on the rpi by adding a blank ssh file in the /boot directory of the SD card
  3. Connect the rpi power supply and insert the SD card
  4. Connect ethernet cable between the rpi and router
  5. SSH into the rpi
  6. Follow Adafruit’s tutorial to connect and configure the rpi to the printer

LED and button wiring

Wire up the LED, button, and resistor as follows:

breadboard diagram

Helpful Resources

NYT Mini Bot scripts

Requirements: npm, Node v14+, Python 3.7+ (pre-installed on newer rpi OS images)

  1. SSH into the rpi and clone this repo
  2. Run ./install.sh (note: the first sections of this install script overlaps with the printer tutorial steps from above; can skip. Just make sure the Python-Thermal-Printer/Adafruit_Thermal.py file is copied within the nyt-mini-bot repo)
  3. Run ./xword-printer.py
  4. Press the button!

xword-fetcher.js script

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:

  1. If outside of the pi, remove executablePath: 'chromium-browser', from the puppeteer.launch line
  2. Run npm run start

xword-printer.py script

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.

Bonus

Craft a shell for your printer

NYT Mini Bot - custom shell material: shoebox

Other improvements

TODO:

  • Trigger xword-printer.py script on rpi boot
  • Get WiFi working on rpi

About

Raspberry Pi bot that prints out the New York Times Daily Mini Crossword on a receipt.

Resources

Stars

Watchers

Forks