1.0.6 • Published 6 years ago

bahn-kursbuch v1.0.6

Weekly downloads
2
License
GPL-2.0
Repository
github
Last release
6 years ago

bahn-kursbuch

This NodeJS module is an API for http://kursbuch.bahn.de/hafas/kbview.exe.

Code Example

const kursbuch = require('bahn-kursbuch');

//Lookup KBS 360 entry
kursbuch.tableLookup("360").then(function(res) {
  console.log(res);
});

//Lookup every Kursbuch entry at "Osnabrück HBF" over "Halen"
kursbuch.stationLookup("008000294","","Halen").then(function(res) {
  console.log(res);
});

//Lookup every Kursbuch entry for "NWB" trains at "Osnabrück HBF"
kursbuch.stationLookup("008000294","","","NWB").then(function(res) {
  console.log(res);
});

//Lookup every Kursbuch entry for line "NWB 18" at "Osnabrück HBF"
kursbuch.stationLookup("008000294","NWB 18").then(function(res) {
  console.log(res);
});

//Lookup Kursbuch entries for train "NWB82300"
kursbuch.trainLookup("NWB82300").then(function(res) {
  console.log(res);
});

"008000294" gives the same results as "Osnabrück HBF", the ID's can be obtained for example with db-hafas (Could also be implemented through Kursbuch, maybe later).

Output format example

kursbuch.trainLookup("NWB82300").then(function(res) {
  console.log(res);
});

Returns:

[ { doc: 'http://kursbuch.bahn.de/hafas/kbview.exe/dn/KB392_Mo_Fr_H_Mo_Fr_G24112017.pdf?filename=KB392_Mo_Fr_H_Mo_Fr_G24112017.pdf&orig=',
    kbs: '392',
    line: 'NWB 18',
    route: 'Wilhelmshaven - Oldenburg - Cloppenburg - Osnabrück',
    date: '24.11.2017' } ]

Installation

npm install bahn-kursbuch
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago