2018-03-14 14:54:08 +01:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const createClient = require('../..')
|
|
|
|
const nahshProfile = require('.')
|
|
|
|
|
2018-07-19 21:55:03 +02:00
|
|
|
const client = createClient(nahshProfile, 'hafas-client-example')
|
2018-03-14 14:54:08 +01:00
|
|
|
|
|
|
|
// Flensburg Hbf to Kiel Hbf
|
2018-03-15 09:33:31 +01:00
|
|
|
client.journeys('8000103', '8000199', {results: 10, tickets: true})
|
2018-03-14 14:54:08 +01:00
|
|
|
// client.departures('8000199', {duration: 10})
|
2018-06-28 13:00:33 +02:00
|
|
|
// client.arrivals('8000199', {duration: 5, stationLines: true})
|
2018-06-29 15:05:29 +02:00
|
|
|
// client.trip('1|30161|5|100|14032018', 'Bus 52')
|
2018-03-14 14:54:08 +01:00
|
|
|
// client.locations('Schleswig', {results: 1})
|
2018-11-21 19:54:59 +01:00
|
|
|
// client.stop('706990') // Kiel Holunderbusch
|
2018-06-28 12:08:54 +02:00
|
|
|
// client.nearby({
|
|
|
|
// type: 'location',
|
|
|
|
// latitude: 54.295691,
|
|
|
|
// longitude: 10.116424
|
|
|
|
// }, {distance: 60})
|
2018-03-14 14:54:08 +01:00
|
|
|
// client.radar(54.4, 10.0, 54.2, 10.2, {results: 10})
|
2018-08-26 18:35:27 +02:00
|
|
|
// client.reachableFrom({
|
|
|
|
// type: 'location',
|
|
|
|
// address: 'Husum, Berliner Straße 80',
|
|
|
|
// latitude: 54.488995,
|
|
|
|
// longitude: 9.056263
|
|
|
|
// }, {
|
|
|
|
// when: new Date('2018-08-27T10:00:00+0200'),
|
|
|
|
// maxDuration: 20
|
|
|
|
// })
|
2018-03-14 14:54:08 +01:00
|
|
|
|
|
|
|
.then((data) => {
|
2018-12-10 14:38:07 +01:00
|
|
|
console.log(require('util').inspect(data, {depth: null, colors: true}))
|
2018-03-14 14:54:08 +01:00
|
|
|
})
|
|
|
|
.catch(console.error)
|