mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 23:29:35 +02:00
HVV examples 📝
This commit is contained in:
parent
3ab099b8e7
commit
57c71865ba
1 changed files with 47 additions and 0 deletions
47
p/hvv/example.js
Normal file
47
p/hvv/example.js
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const createClient = require('../..')
|
||||||
|
const hvvProfile = require('.')
|
||||||
|
|
||||||
|
const client = createClient(hvvProfile, 'hafas-client-example')
|
||||||
|
|
||||||
|
// client.journeys('116', '5900', {results: 1, polylines: true})
|
||||||
|
// client.departures('116', {duration: 1})
|
||||||
|
// client.arrivals('116', {duration: 10, linesOfStops: true})
|
||||||
|
client.locations('dammtor', {results: 2})
|
||||||
|
// client.stop('116', {linesOfStops: true}) // Dammtor
|
||||||
|
// client.nearby({
|
||||||
|
// type: 'location',
|
||||||
|
// latitude: 53.554422,
|
||||||
|
// longitude: 9.977934
|
||||||
|
// }, {distance: 60})
|
||||||
|
// client.radar({
|
||||||
|
// north: 53.55,
|
||||||
|
// west: 9.95,
|
||||||
|
// south: 52.51,
|
||||||
|
// east: 10
|
||||||
|
// }, {results: 10})
|
||||||
|
// client.reachableFrom({
|
||||||
|
// type: 'location',
|
||||||
|
// address: 'Hamburg, Holstenwall 9',
|
||||||
|
// latitude: 53.553766,
|
||||||
|
// longitude: 9.977514
|
||||||
|
// }, {
|
||||||
|
// when: new Date('2019-05-16T10:00:00+0200'),
|
||||||
|
// maxDuration: 8
|
||||||
|
// })
|
||||||
|
|
||||||
|
// .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)
|
Loading…
Add table
Reference in a new issue