mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 23:29:35 +02:00
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
'use strict'
|
|
|
|
const createClient = require('../..')
|
|
const kvbProfile = require('.')
|
|
|
|
const client = createClient(kvbProfile, 'hafas-client example')
|
|
|
|
const heumarkt = '900000001'
|
|
const poststr = '900000003'
|
|
|
|
// client.journeys(heumarkt, poststr, {
|
|
// results: 1, stopovers: true,
|
|
// })
|
|
// .then(({journeys}) => {
|
|
// const [journey] = journeys
|
|
// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true})
|
|
// })
|
|
// .then(({journeys}) => {
|
|
// const [journey] = journeys
|
|
// const leg = journey.legs[0]
|
|
// return client.trip(leg.tripId, leg.line.name, {polyline: true})
|
|
// })
|
|
|
|
// client.departures(heumarkt, {duration: 1})
|
|
// client.arrivals(heumarkt, {duration: 10, linesOfStops: true})
|
|
|
|
client.locations('heumarkt', {results: 3})
|
|
// client.stop(heumarkt, {linesOfStops: true})
|
|
// client.nearby({
|
|
// type: 'location',
|
|
// id: '991023531',
|
|
// address: 'An den Dominikanern 27',
|
|
// latitude: 50.942454, longitude: 6.954064,
|
|
// }, {distance: 500})
|
|
// client.reachableFrom({
|
|
// type: 'location',
|
|
// id: '991023531',
|
|
// address: 'An den Dominikanern 27',
|
|
// latitude: 50.942454, longitude: 6.954064,
|
|
// }, {
|
|
// maxDuration: 15,
|
|
// })
|
|
|
|
.then((data) => {
|
|
console.log(require('util').inspect(data, {depth: null, colors: true}))
|
|
})
|
|
.catch(console.error)
|