Giter Site home page Giter Site logo

maxwipfli / swisstransitdisplay Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 320 KB

SwissTransitDisplay is a PHP web application which show departures from a Swiss transit stop in realtime.

License: MIT License

PHP 49.24% CSS 10.96% JavaScript 14.45% HTML 18.25% Dockerfile 7.11%

swisstransitdisplay's Introduction

SwissTransitDisplay

SwissTransitDisplay is a PHP web application which show departures from a Swiss transit stop in realtime.

It uses an opentransportdata.swiss API and displays departures in dot-matrix-display style.

It looks approximately like this: Screenshot of SwissTransitDisplay

Installation

SwissTransitDisplay runs on any webserver capable of serving PHP and static files, such as PHP/Apache. Copy all files in src/ into the document root of the webserver.

Furthermore, an API key is needed, which can be obtained for free:

  1. Go to opentransportdata.swiss and register there.
  2. Click on API keys in the header bar, and request a new VDV 431 Default token.
  3. Install the token as described in the Configuration section below.

Configuration

The display can be configured using the src/config.json file. An example is present in the src/config.example.json file. The following configurations are available:

  • api_key: The opentransportdata.swiss API key.
  • departure_count: The number of departures displayed.
  • stop_id: The DiDok ID of the stop (e.g. 8591316 for "Zürich, Rennweg"). The ID can be found most easily on this map. Click on any transit stop icon, then "More info". The ID can be found in the "Number" field.
  • stop_name: The name of the stop as display on the top.
  • name_transformations: An object which can be used to change how certain stops are displayed. For example, "Zürich Enge, Bahnhof" might be changed to "Bahnhof Enge", as it is probably obvious that it is located in Zurich. The key describes the official name as provided by the API and the value can be changed as preferred.

Docker

The repository contains a Dockerfile to build a container image for the service. When using it, mount the configuration file to /config.json in the container's file system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.