A newspaper-style TV guide Preact app that fetches FieldStation42 schedule data (for the current day only) and enriches it with TMDb movie/TV information and lots of other bells and whistles.
Built to work with the terrific FieldStation42 project by Shane Mason.
It features:
- An authentic-looking newspaper TV guide styling
- Certificate ratings, star ratings, and screengrabs for movies
- Highlighting of the current time slot and current shows
- The ability to click channel names to change to that channel
sudo apt update && sudo apt upgrade -y# Install Node.js 18.x
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
# Verify installation
node --version
npm --version# Navigate to your preferred directory
cd /home/pi
# Clone or copy your project files
# If using git:
git clone https://github.com/sandyjmacdonald/fs42-tv-guide.git
cd fs42-tv-guide
# Or if copying files manually, create the directory structure:
mkdir fs42-tv-guide
cd fs42-tv-guide
# Copy all your project files herenpm installCreate a .env file in the project root directory:
nano .envAdd the following variables to your .env file:
# FS42 TV API Configuration
# Use http://127.0.0.1:4242 if running on same machine as
# FieldStation42
FS42_API_URL=http://your-fs42-server:port
# TMDb API Configuration
TMDB_KEY=your_tmdb_api_key_here
# Server Configuration
PORT=3000
# Optional: Channels to ignore (comma-separated)
IGNORE_CHANS=Shopping Channel,Infomercials,Test Channel- Visit The Movie Database (TMDb)
- Create a free account
- Go to Settings → API
- Request an API key (choose "Developer" option)
- Copy your API key to the
TMDB_KEYvariable
- Replace
http://your-fs42-server:portwith your actual FieldStation42 web API endpoint
(NOTE: for some reason it is necessary to use 127.0.0.1 rather than localhost if running on the same machine)
For the app to properly detect and enrich movies and TV shows with TMDb data, your TV show/movie files must follow specific naming conventions:
TV episodes must be formatted as:
Series Name - S##E##
Examples:
Breaking Bad - S01E01The Office – S03E12Game of Thrones - S08E06
Notes:
- Use a hyphen (
-) as the separator - Season and episode numbers should 2 digits
- The application will extract series name, season, and episode numbers
- Multi-part episodes like
S01E01-E02are supported
Movies must include the release year in parentheses:
Movie Title (YYYY)
Examples:
The Shawshank Redemption (1994)Inception (2010)Top Gun: Maverick (2022)
Notes:
- The year must be exactly 4 digits in parentheses at the end
- The application will extract movie title and year for TMDb lookup
- Movies will display star ratings and additional metadata
Programs that don't match these patterns will be treated as generic programming:
- Live events, news, sports
- Specials without standard episode formatting
- Local programming
Off-Air Detection:
- Programs titled
offair(FieldStation42 will call off-air time this, case-insensitive) will be styled as off-air blocks - Consecutive off-air blocks will be automatically merged
Ensure the app has proper permissions:
chmod +x server.js
chmod 644 .env# Start the server
node server.jsThe app will be available at:
- Local access:
http://localhost:3000 - Network access:
http://[raspberry-pi-ip]:3000
To find your Raspberry Pi's IP address:
hostname -ICreate a systemd service to automatically start the application:
# Create service file
sudo nano /etc/systemd/system/fs42-tv-guide.serviceAdd the following content:
[Unit]
Description=TV Guide Application
After=network.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/fs42-tv-guide
ExecStart=/usr/bin/node server.js
Restart=always
RestartSec=10
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.targetEnable and start the service:
# Reload systemd
sudo systemctl daemon-reload
# Enable auto-start
sudo systemctl enable fs42-tv-guide
# Start the service
sudo systemctl start fs42-tv-guide
# Check status
sudo systemctl status fs42-tv-guideThis project is licensed under the MIT License - see the LICENSE file for details.

