db-vendo-client/p/vmt/example.js

45 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-03-02 23:16:45 +01:00
'use strict'
const createClient = require('../..')
const vmtProfile = require('.')
const client = createClient(vmtProfile, 'hafas-client-example')
const jena = '190014'
2021-04-18 19:18:41 +02:00
const gothaZOB = '167280'
2020-03-02 23:16:45 +01:00
client.journeys(jena, gothaZOB, {results: 1})
// client.departures(jena)
// client.arrivals(jena, {duration: 10, linesOfStops: true})
// client.locations('ohrdruf', {results: 2})
// client.stop(jena, {linesOfStops: true}) // Dammtor
// client.nearby({
// type: 'location',
// latitude: 50.975615,
// longitude: 11.032374
// })
// client.reachableFrom({
// type: 'location',
// id: '980348376',
// address: 'Erfurt, Grafengasse 12',
// latitude: 50.975993, longitude: 11.031553
// }, {
// when: new Date('2020-03-04T10:00:00+01:00')
// })
// .then(({journeys}) => {
// const [journey] = journeys
// const leg = journey.legs[0]
// return client.trip(leg.tripId, leg.line.name, {polyline: true})
// })
// .then(({journeys}) => {
// const [journey] = journeys
// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true})
// })
.then((data) => {
console.log(require('util').inspect(data, {depth: null, colors: true}))
})
.catch(console.error)