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

34 lines
824 B
JavaScript
Raw Normal View History

2018-04-12 21:25:40 +02:00
'use strict'
const createClient = require('../..')
const cflProfile = require('.')
2018-06-10 20:44:12 +02:00
const client = createClient(cflProfile, 'hafas-client-example')
2018-04-12 21:25:40 +02:00
// from Mersch to Pfaffenthal-Kirchberg
// client.journeys('009864348', '008200102', {results: 1})
client.departures('009864348', { duration: 5 })
// client.locations('Pfaffenthal Kirchberg', {results: 2})
// client.station('009864348') // Mersch
// client.nearby({
// type: 'location',
// latitude: 49.7523,
// longitude: 6.1103
// }, {distance: 500})
// client.radar({
// north: 49.9,
// west: 6.11,
// south: 49.7,
// east: 6.13
// }, {results: 10})
// .then(([journey]) => {
// const leg = journey.legs[0]
2018-06-10 20:44:12 +02:00
// return client.trip(leg.id, leg.line.name)
2018-04-12 21:25:40 +02:00
// })
.then(data => {
console.log(require('util').inspect(data, { depth: null }))
})
.catch(console.error)