Skip to content

smaller-world/postprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postprint

a minimal cli for printing smaller world posts with a receipt printer.

dev setup

  • Go via mise (e.g. mise install go)
  • System printing tools (lp, lpstat) if you want to send to a printer
  • Playwright will download Chromium on first run (cached under ~/Library/Caches/ms-playwright-go or ~/.cache/ms-playwright-go)

build

cd postprint
mise exec -- go build -o postprint

usage (interactive)

./postprint [--debug] [--local]
  • you'll first choose a mode:
    • "Watch a space (print new posts as they arrive)"
    • "Print a single post (by ID)"
  • for a space, enter either:
    • The friendly ID (some-name-abcdef0123456789abcdef0123456789)
    • The raw UUID (with or without dashes)
    • The full space URL (uses its host; otherwise defaults to https://smallerworld.club)
  • for a post, enter the post ID (posts don't have public URLs).

then you'll pick how to output:

  • default: "save to downloads only" (always saves to ~/Downloads)
  • Or pick a printer from lpstat -p (PDF still saved to ~/Downloads)

notes

  • hosts allowed: smallerworld.club or localhost (for local dev).
  • override the default base with --local (uses http://localhost:3000 when the space input isn't a URL).
  • printing uses lp -o media=Custom.{width}x{height}mm -o fit-to-page with dynamic dimensions derived from the rendered .PostCard.
  • space polling interval: 1s. it tracks seen post IDs and creation timestamps to avoid duplicates.

About

print smaller world posts to a receipt printer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages