A Rust terminal application that displays Finnish Liiga hockey results in authentic YLE Teksti-TV style.
- Authentic teletext interface - YLE Teksti-TV channel 221 appearance
- Real-time updates - Automatic refresh (every minute for live games, hourly for completed)
- Tournament support - Regular season, playoffs, playout, qualifications, practice games
- Interactive navigation - Arrow keys for page navigation, automatic date navigation
- Detailed game info - Scores, goal scorers with timestamps, video links
- Multiple display modes - Compact (multi-column), wide (side-by-side), standard
- Configuration system - Platform-specific storage, customizable settings
- Performance optimized - Caching, request deduplication, intelligent refresh intervals
- Rust 1.89 or newer - This project uses modern Rust features including if-let chains
- Terminal with Unicode support for best display experience
You can check your Rust version with:
rustc --versionIf you need to update Rust, visit rustup.rs or run:
rustup updatecargo install liiga_teletextYou can create a symlink to the binary to make it available from anywhere:
sudo ln -s ~/.cargo/bin/liiga_teletext /usr/local/bin/221 # 221 is the channel number of YLE Teksti-TV-
Make sure Rust and Cargo are installed on your system. If not, install them from rustup.rs.
-
Clone this repository:
git clone https://github.com/nikosalonen/liiga_teletext.git
cd liiga_teletext- Build and run the application:
cargo build --release
cargo run --release- Press
qto quit the application - Use left/right arrow keys to navigate between pages
- Use Shift+Left/Right to navigate between dates with games
- Note: Date navigation is limited to the current season for performance and UX reasons
- To view games from previous seasons, use the
-dflag with a specific date
- Press
rto manually refresh data - Data refreshes automatically:
- Every minute for live games
- Every hour for non-live games
-d, --date <DATE>- Show games for a specific date in YYYY-MM-DD format-o, --once- Show scores once and exit immediately (useful for scripts)-p, --plain- Disable clickable video links in the output-c, --compact- Enable compact mode with space-efficient multi-column layout-w, --wide- Enable wide mode with two-column side-by-side layout (requires 128+ character wide terminal)--min-refresh-interval <SECONDS>- Set minimum refresh interval in seconds (default: auto-detect based on game count). Higher values reduce API calls but may miss updates. Use with caution.
--config [DOMAIN]- Update API domain in config (prompts if not provided)- Breaking Change: The
-cshort flag has been removed to avoid conflict with--compact. Use the full--configflag instead.
- Breaking Change: The
--set-log-file <PATH>- Set a persistent custom log file location--clear-log-file- Clear custom log file path and revert to default location-l, --list-config- List current configuration settings
--debug- Enable debug mode (doesn't clear terminal, logs to file)--log-file <PATH>- Specify a custom log file path for this session
-V, --version- Show version information
Space-efficient multi-column layout with team abbreviations. Adapts from 1-3 columns based on terminal width.
liiga_teletext --compact --once # Quick compact viewSide-by-side two-column layout for wide terminals (128+ characters). Shows full game details in each column.
liiga_teletext --wide --date 2025-03-21 # Wide view for specific dateWhen multiple players share the same last name on a team, the app automatically adds first initials for clarity (e.g., "Koivu M.", "Koivu S."). This works per-team, so players with the same last name on different teams remain unchanged.
On first run, you will be prompted to enter your API domain. This will be saved to a config file at:
- Linux:
~/.config/liiga_teletext/config.toml - macOS:
~/Library/Application Support/liiga_teletext/config.toml - Windows:
%APPDATA%\liiga_teletext\config.toml
The configuration can be manually edited at any time by modifying this file. You can:
- Update the API domain
- Set a custom log file path
The application includes comprehensive logging that can be configured:
- Default location:
~/.config/liiga_teletext/logs/liiga_teletext.log - Custom location: Can be set via
--set-log-fileor--log-file - Debug mode: Logs are written to file instead of terminal display
- Log rotation: Logs are automatically rotated by date
The application intelligently handles different tournament types based on the season:
- Regular Season (
runkosarja) - Main league games (September-April) - Playoffs (
playoffs) - Championship playoffs (March-June) - Playout (
playout) - Relegation playoffs (March-June) - Qualifications (
qualifications) - Qualification games (March-June) - Practice Games (
valmistavat_ottelut) - Preseason practice games (May-September)
During off-season periods, the app shows a countdown to the next regular season start.
- Smart caching - HTTP response caching with time-based expiration
- Request deduplication - Prevents simultaneous identical API calls
- Adaptive refresh - Intelligent intervals based on game state and count
- Connection pooling - Efficient HTTP connection reuse
- Async architecture - Non-blocking operations for responsive UI
# Build and test
cargo build --all-features
cargo test --all-features
# Code quality checks
cargo fmt
cargo clippy --all-features --all-targets -- -D warningsUses Rust 2024 edition with modular architecture: CLI/main, data fetcher, teletext UI, config, and performance modules.
Contributions are welcome! Please feel free to submit a Pull Request. See CONTRIBUTING.md for detailed guidelines including commit message format and development workflow.
Important: Before submitting any changes, please ensure:
- All tests pass:
cargo test --all-features - Code is formatted:
cargo fmt - No clippy warnings:
cargo clippy --all-features --all-targets -- -D warnings - New functionality includes appropriate tests
- Follow conventional commits for commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- YLE Teksti-TV for the design inspiration
- NHL-235 by Juha-Matti Santala for pioneering the concept of bringing teletext hockey scores to the terminal. My original inspiration for this project.