leonghui / gwr-feed

Simple script to generate a JSON feed for train tickets from GWR.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gwr-feed

A simple Python script to generate a JSON Feed for search for train tickets on Great Western Railway. Only supports single (one-way) journeys.

Served over Flask!

Use the Docker build to host your own instance.

  1. Set your timezone as an environment variable (see docker docs): TZ=America/Los_Angeles

  2. Access the feed using the URL with origin and destination station codes: http://<host>/?from=BHM&to=EUS

  3. Optionally, specify a:

    • date (yyyyMMdd): http://<host>/?from=BHM&to=EUS&on=20221225
    • time (hhmm): http://<host>/?from=BHM&to=EUS&at=1200
    • number of weeks to look ahead: http://<host>/?from=BHM&to=EUS&weeks=2
    • or any combination of the above

Note: set a longer timeout on your feed reader if you use the 'weeks' option

E.g.

Train prices from MAN (Manchester Piccadilly) to PAD (London Paddington) at 9pm:

Feed link:
http://<host>/?from=MAN&to=PAD&at=2100

Tested with:

About

Simple script to generate a JSON feed for train tickets from GWR.com

License:MIT License


Languages

Language:Python 98.2%Language:Dockerfile 1.8%