Giter VIP home page Giter VIP logo

delaymapi's Introduction

DelayMapI

codecov

The API for DelayMap 3.0.0.

Installation

  1. Make sure you have protoc installed
  2. Cargo run --release

API format

All endpoints accept the url parameter language for the following languages:

  • English (language=en, default)
  • Dutch (language=nl)
  • French (language=fr)
  • German (language=de)

/trains

Returns a list of DelayMapTrain with the following structures:

struct DelayMapStopTime {
    id: String;
    name: String,
    lat: Option<f64>,
    lon: Option<f64>,
    arrival_delay: i32,         // In seconds
    arrival_timestamp: u32,     // In seconds after midnight
    departure_delay: i32,       // In seconds
    departure_timestamp: u32,   // In seconds after midnight
    stop_id: String,
}

struct DelayMapTrain {
    name: String,
    stops: Vec<DelayMapStopTime>,
    stop_index: usize,
    is_stopped: bool,
    estimated_lat: f64,
    estimated_lon: f64,
}

/works

Returns a list of DelayMapWorks with the following structures:

struct DelayMapStop {
    name: String,
    lat: Option<f64>,
    lon: Option<f64>,
    stop_id: String,
}

struct DelayMapURL {
    url: String,
    label: String,
}

struct DelayMapWorks {
    id: String,
    name: String,
    message: String,
    impacted_station: Option<DelayMapStop>,
    start_date: String,
    end_date: String,
    start_time: String,
    end_time: String,
    urls: Vec<DelayMapURL>,
}

delaymapi's People

Watchers

 avatar  avatar

delaymapi's Issues

Translations

Now, everything is in French by default, we should read the translations and translate them to the language requested by the browser.

Handle NMBS downtime

The realtime data is not always available, maybe DelayMapI needs to keep the old delay data cached, as the downtime is often not too long...

Midnight trains

It seems that after or around midnight, all trains appear as not having left their station. I need to look into this.

Canceled trains

Canceled trains are shown as normal trains.

Example: the train from Antwerpen-Centraal to Turnhout on 28/03/2022 that would have arrived in Tielen at 14u30.

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.