GitHunt
AL

Alicimo/train_timetable

Bad Vöslau → Wien Hbf Train Updates

A static train departure website showing trains from Bad Vöslau to Vienna Central Station (Wien Hauptbahnhof).

Architecture

Node.js Data Fetcher + Static Bootstrap UI

  • fetch_departures.js: Uses oebb-hafas to fetch live departure data
  • index.html: Single-file Bootstrap interface that renders the timetable
  • departures.json: JSON data file generated by the fetcher

Quick Start

npm install
node fetch_departures.js  # Fetch latest data

Open index.html in your browser to view the timetable.

Development Commands

npm install
node fetch_departures.js   # Test data fetching

Important Note for HAFAS Client

After running npm install, you may need to update the ÖBB API version number in the HAFAS client configuration:

# If you encounter API version errors, update the version in:
# node_modules/hafas-client/p/oebb/base.json
# Change the version number to "1.45" or the latest version

This is required because the ÖBB API occasionally updates their version requirements, and the hardcoded version in the HAFAS client may become outdated.

Dependencies

  • Node.js: oebb-hafas for reliable ÖBB API access

Features

  • ✅ Live departure times from Bad Vöslau
  • ✅ Filtered for trains going to Vienna (Wien)
  • ✅ Real-time delay information
  • ✅ Clean, responsive web interface
  • ✅ Auto-refresh functionality
  • ✅ Platform and train type information

Benefits of New Architecture

  • Reliability: Uses well-tested hafas-client library instead of custom API implementation
  • Maintainability: Separation of concerns - Node.js handles API complexity, Python handles UI
  • Performance: Pre-filtered data reduces processing time
  • Debugging: Easier to troubleshoot issues in focused components

How It Works

  1. Data Fetching: Node.js script queries ÖBB HAFAS API for departures
  2. Filtering: Filters for trains going to Vienna and Bad Vöslau routes
  3. Data Bridge: Saves filtered results to departures.json
  4. UI Display: Static HTML reads JSON and presents a clean interface
  5. Auto-refresh: The page refreshes data on a timer

GitHub Pages Deployment

This repo includes a GitHub Actions workflow that:

  1. Runs node fetch_departures.js on a schedule.
  2. Commits the updated departures.json.
  3. Publishes the static site to GitHub Pages.

To enable it:

  1. In your repo settings, set Pages to deploy from GitHub Actions.
  2. Run the workflow manually or wait for the scheduled refresh.