Skip to content

Running on Linux and Raspberry Pi

Jef LeCompte edited this page Jul 20, 2025 · 1 revision

Here’s a quick guide for installing Node.js on Linux and Raspberry Pi (Raspbian OS) and setting up a daily scheduled task to run your zap2xml script with the required arguments:

  1. Installing Node.js

    1. Open Terminal.
    2. Update your package list:
      sudo apt update
    3. Install Node.js (LTS version):
      sudo apt install nodejs npm
    4. Verify installation:
      node -v
      npm -v
  2. Install zap2xml dependencies and build

In Terminal, run:

cd /path/to/zap2xml
npm install
npm run build
  1. Create a shell script to run zap2xml

Create a file named run-zap2xml.sh in your zap2xml folder with the following content (edit the arguments as needed):

#!/bin/bash
cd /path/to/zap2xml
node dist/index.js --lineupId=YOUR_LINEUP_ID --timespan=15 --country=USA --postalCode=12345

Replace YOUR_LINEUP_ID, 15, USA, and 12345 with your actual values.

Make the script executable:

chmod +x run-zap2xml.sh
  1. Schedule a daily task using cron
    1. Open crontab editor:
      crontab -e
    2. Add the following line to run the script daily at 2:00 AM (adjust time as needed):
      0 2 * * * /path/to/zap2xml/run-zap2xml.sh
      
    3. Save and exit.

This will run your zap2xml script once a day with your specified arguments on your Linux machine or Raspberry Pi.

Clone this wiki locally