Skip to content

andreas1327250/Claude-Code-Web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ÖBB Train Seat Availability App

A simple web application that shows train seat availability between Linz and Vienna using reverse-engineered ÖBB (Österreichische Bundesbahnen) public endpoints.

Features

  • 🚆 Real-time train connections between Linz and Vienna
  • ⏰ Customizable departure date and time
  • 💺 Seat availability information
  • 📊 Train details including duration, platform, and pricing
  • 🎨 Modern, responsive UI

🚀 Live Demo

This app is automatically deployed to GitHub Pages:

🔗 View Live App

The deployment happens automatically via GitHub Actions whenever changes are pushed to the repository.

📦 Deployment

GitHub Pages (Automatic)

This repository is configured for automatic deployment to GitHub Pages:

  1. Automatic deployment via GitHub Actions on every push
  2. Live URL: https://andreas1327250.github.io/Claude-Code-Web/
  3. Workflow file: .github/workflows/deploy.yml

Local Testing

Run the app locally with Python's built-in server:

# Start local server
python3 server.py
# or
npm run serve

# Open http://localhost:8000 in your browser

Manual Deployment to Other Platforms

Vercel:

npm i -g vercel
vercel

Netlify:

npm i -g netlify-cli
netlify deploy

Cloudflare Pages, Firebase, or AWS S3: Simply upload the HTML, CSS, and JS files to your hosting platform.

Reverse-Engineered ÖBB Endpoints

This app uses the public HAFAS (HaCon Fahrplan-Auskunfts-System) endpoints provided by ÖBB:

1. Station Search Endpoint

GET https://fahrplan.oebb.at/bin/ajax-getstop.exe/dn

Parameters:

  • getstop=1 - Enable station search
  • REQ0JourneyStopsS0A=1 - Return all matches
  • REQ0JourneyStopsS0G={query} - Station name query

Response Format: Tab-separated values with station name and ID:

Wien Hbf	8103000
Wien Meidling	8101073
...

2. Journey Query Endpoint

GET https://fahrplan.oebb.at/bin/query.exe/dn

Parameters:

  • S={from_station} - Origin station name
  • Z={to_station} - Destination station name
  • date={DD.MM.YY} - Departure date
  • time={HH:MM} - Departure time
  • start=1 - Search type (1 = departure)

Response: HTML page with journey connections

3. Station Board Endpoint

GET https://fahrplan.oebb.at/bin/stboard.exe/dn

Shows departures/arrivals for a specific station.

4. Live Train Map

GET http://zugradar.oebb.at/bin/help.exe/dn?tpl=livefahrplan

Displays all trains on a live map.

API System: HAFAS

ÖBB uses the HAFAS (HaCon Fahrplan-Auskunfts-System) API, which is a journey planning system used by many European transportation providers. The same system is used by:

  • Deutsche Bahn (Germany)
  • SBB (Switzerland)
  • NS (Netherlands)
  • And many others

How to Use

  1. Open index.html in a web browser
  2. Select your departure date and time (defaults to current time)
  3. Click "Search Trains"
  4. View available train connections with seat availability

Technical Details

CORS Proxy

Since the ÖBB endpoints don't support CORS (Cross-Origin Resource Sharing), the app uses a CORS proxy service (allorigins.win) to fetch data. For production use, consider:

  1. Setting up your own backend proxy server
  2. Using the official ÖBB API Portal (requires registration)
  3. Running the app from a server that can make backend requests

Mock Data

Currently, the app generates mock data for demonstration purposes because parsing the HTML response from ÖBB requires more sophisticated parsing. To implement real data:

  1. Parse the HTML response from query.exe/dn
  2. Or use existing libraries like:

Alternative: Use Existing Libraries

For a production implementation, consider using existing open-source libraries:

# Node.js example with oebb-api
npm install oebb-api

# Usage
const oebb = require('oebb-api');

oebb.searchStationsNew("Linz Hbf").then((from) => {
    oebb.searchStationsNew("Wien Hbf").then((to) => {
        oebb.getJourneys(from[0], to[0], true).then(console.log);
    });
});

Official ÖBB API

For production use, ÖBB provides an official API portal:

You need to register and request access to use official APIs.

Resources

Disclaimer

This is an educational project demonstrating how to reverse-engineer public transportation APIs. For production use:

  1. Use the official ÖBB API Portal
  2. Request permission from ÖBB
  3. Respect rate limits and terms of service
  4. Consider data privacy and GDPR compliance

License

This project is for educational purposes only. ÖBB and its data remain property of Österreichische Bundesbahnen.

Contributing

Feel free to improve the HTML parsing, add more features, or enhance the UI!

Future Enhancements

  • Implement real HTML parsing for actual ÖBB data
  • Add more station pairs
  • Show platform changes
  • Display train composition
  • Add ticket booking links
  • Implement real seat availability (requires official API)
  • Add delay notifications
  • Support for multiple routes
  • Mobile app version

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published