Skip to content

FriendlyUser1/times-puzzles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

times-puzzles

Scripts to scrape and print The Times daily puzzles.

Overview

This repository contains two utilities:

  • app.js: Scrapes The Times printable puzzles page, finds puzzle PDF links, downloads them, and tracks already-downloaded dates in puzzleScraperDatabase.json.
  • print_crosswords.sh: Prints selected pages from a puzzle PDF based on the day of the week.

Requirements

  • Node.js (for app.js)
  • npm
  • pdftk (required by the print script)
  • CUPS printing tools (lp, lpstat, lpoptions)

Installation / Setup

  1. Install Node.js dependencies:

    npm install
  2. Install pdftk (example for Debian/Ubuntu):

    sudo apt-get update
    sudo apt-get install pdftk
  3. Ensure you have a default printer configured in CUPS using lpoptions:

    lpoptions -d YOUR_PRINTER_NAME

    You can list available printers with:

    lpstat -p -d
  4. Create your local environment file and set your puzzle directory path:

    cp .env.example .env

    Then edit .env and set:

    PUZZLE_DIR=/your/path/to/puzzles

Usage

Download puzzle PDFs

Before running, make sure PUZZLE_DIR in .env points to your own puzzles folder.

Run:

node app.js

This downloads newly found puzzle PDFs into the folder configured by PUZZLE_DIR and records downloaded dates in puzzleScraperDatabase.json.

Print puzzle pages

Before running, make sure PUZZLE_DIR in .env points to your own puzzles folder.

Run without arguments to print today's puzzle file (expected as DDMMYY.pdf in the folder configured by PUZZLE_DIR):

./print_crosswords.sh

If today's file is missing, the script will first run node app.js from this repository to fetch puzzles, then continue printing.

Run with a specific file path:

./print_crosswords.sh /path/to/your/file.pdf

The script prints a day-specific set of pages and sends the output to your default printer.

About

Scripts to scrape and print The Times daily puzzles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors