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: Usesoebb-hafasto fetch live departure dataindex.html: Single-file Bootstrap interface that renders the timetabledepartures.json: JSON data file generated by the fetcher
Quick Start
npm install
node fetch_departures.js # Fetch latest dataOpen index.html in your browser to view the timetable.
Development Commands
npm install
node fetch_departures.js # Test data fetchingImportant 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 versionThis 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-hafasfor 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-clientlibrary 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
- Data Fetching: Node.js script queries ÖBB HAFAS API for departures
- Filtering: Filters for trains going to Vienna and Bad Vöslau routes
- Data Bridge: Saves filtered results to
departures.json - UI Display: Static HTML reads JSON and presents a clean interface
- Auto-refresh: The page refreshes data on a timer
GitHub Pages Deployment
This repo includes a GitHub Actions workflow that:
- Runs
node fetch_departures.json a schedule. - Commits the updated
departures.json. - Publishes the static site to GitHub Pages.
To enable it:
- In your repo settings, set Pages to deploy from GitHub Actions.
- Run the workflow manually or wait for the scheduled refresh.