Git Product home page Git Product logo

node-wili's Introduction

wili

License Version Build

English | Deutsch

A Node wrapper for the Wiener Linien public transport API

Installation

npm install wili

Usage

Example usage in script:

import { createWienerLinien } from 'wili';

const wili = createWienerLinien();

const options = {
  relatedLine: ['U2', 'U4', 'U6']
};

try {
  const data = await wili.trafficInfoList(options);
  console.log(data.trafficInfos);
} catch (output) {
  console.error(error);
}

⚠️ For NodeJS versions lower than v18, the class needs to be instantiated with a fetch-implementation

Example

import { createWienerLinien } from 'wili';
import fetch from 'isomorphic-fetch';

const wili = createWienerLinien(fetch);

API

monitor

Usage: monitor(rbl, [options])

Returns real-time data for a station, including train information such as identifier or accessibility features.

Parameters:

rbl

Type: String, Integer, Array

RBL number (Rechnergestütztes Betriebsleitsystem - computer-aided operations control system), can be found this website

options.activeTrafficInfo

Type: String, Array

Disruption type (stoerungkurz, stoerunglang, or aufzugsinfo)

newsList

Usage: newsList(options)

Returns news, elevator maintenance and other information

Options

options.relatedLine

Type: String, Integer, Array

Train or bus number, e.g. U1, S7, 59A (case-insensitive)

options.relatedStop

Type: String, Integer, Array

Station ID

options.name

Type: String, Array

Information category, e.g news or aufzugsservice

trafficInfoList

Usage: trafficInfoList([options])

Returns interruption of operations and elevator outage

Options

options.relatedLine

Type: String, Integer, Array

Train or bus number, e.g. U1, S7, 59A (case-insensitive)

options.relatedStop

Type: String, Integer, Array

Station ID

options.name

Type: String, Array

Disruption type (stoerungkurz, stoerunglang, or aufzugsinfo)

License

This work is licensed under The MIT License

node-wili's People

Contributors

blutz3 avatar dependabot[bot] avatar idleberg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

node-wili's Issues

No type declarations found in package

Hi, thanks for this project.

Just wanted to point out that the type declarations seem to be missing in the npm package. (v0.5.1)

TS yields Cannot find module 'wili' or its corresponding type declarations.
when trying to import { WienerLinien } from 'wili'

The folder types/ is not present after intalling via npm.

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.