mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
'use strict'
|
|
|
|
const createClient = require('../..')
|
|
const pkpProfile = require('.')
|
|
|
|
const client = createClient(pkpProfile, 'hafas-client-example')
|
|
|
|
const wrocławGł = '5100069'
|
|
const krakówGł = '5100028'
|
|
|
|
client.journeys(krakówGł, wrocławGł, {results: 1, polylines: true})
|
|
// client.departures(krakówGł, {duration: 10})
|
|
// client.arrivals(krakówGł, {duration: 10, linesOfStops: true})
|
|
// client.locations('kraków', {results: 2})
|
|
// client.stop(krakówGł, {linesOfStops: true})
|
|
// client.nearby({
|
|
// type: 'location',
|
|
// latitude: 50.067192,
|
|
// longitude: 19.947423
|
|
// }, {distance: 60})
|
|
// client.radar({
|
|
// north: 50.2,
|
|
// west: 19.8,
|
|
// south: 49.9,
|
|
// east: 20.1
|
|
// }, {results: 10})
|
|
// client.reachableFrom({
|
|
// type: 'location',
|
|
// address: 'Bydgoszcz, Dworcowa 100',
|
|
// latitude: 53.1336648,
|
|
// longitude: 17.9908571
|
|
// }, {
|
|
// when: new Date(),
|
|
// maxDuration: 20
|
|
// })
|
|
|
|
// .then(({journeys}) => {
|
|
// const [journey] = journeys
|
|
// const leg = journey.legs[0]
|
|
// return client.trip(leg.tripId, leg.line.name, {polyline: true})
|
|
// })
|
|
|
|
.then((data) => {
|
|
console.log(require('util').inspect(data, {depth: null, colors: true}))
|
|
})
|
|
.catch(console.error)
|