Socket
Socket
Sign inDemoInstall

wili

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wili

A Node client for the Wiener Linien public transport API


Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

wili

npm npm CircleCI David David

English | Deutsch

A Node wrapper for the Wiener Linien public transport API

Installation

yarn add wili || npm install wili

Prerequisites

You will need a valid API key to access Wiener Linien's real-time data. Sign up here!

Usage

Use ES6 imports or require() to include the module:

// ECMAScript Import
import WienerLinien from 'wili';

// CommonJS Require
const WienerLinien = require('wili');

Example usage in script:

import WienerLinien from 'wili';

// The API key can be omitted when
// process.env.WIENER_LINIEN_API_KEY is set
const wl = new WienerLinien(API_KEY);

// Promise API
wl.trafficInfoList({ relatedLine: ['U2', 'U4', 'U6'] })
.then( data => {
  console.log(data.trafficInfos);
})
.catch( error => {
  console.error(error);
});

// async/await
(async () => {
  try {
    let data = await wl.trafficInfoList({ relatedLine: ['U2', 'U4', 'U6'] });
    console.log(data.trafficInfos);
  } catch (output) {
    console.error(error);
  }
})();

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

Donate

You are welcome to support this project using Flattr or Bitcoin 17CXJuPsmhuTzFV2k4RKYwpEHVjskJktRd

Keywords

FAQs

Package last updated on 05 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc