2018-03-12 22:43:50 +01:00
|
|
|
'use strict'
|
2018-02-26 22:14:11 +01:00
|
|
|
|
2018-03-12 22:43:50 +01:00
|
|
|
const createClient = require('../..')
|
|
|
|
const insaProfile = require('.')
|
2018-02-26 22:14:11 +01:00
|
|
|
|
2018-07-19 21:55:03 +02:00
|
|
|
const client = createClient(insaProfile, 'hafas-client-example')
|
2018-02-26 22:14:11 +01:00
|
|
|
|
|
|
|
// from Magdeburg-Neustadt to Magdeburg-Buckau
|
2018-03-12 22:43:50 +01:00
|
|
|
client.journeys('008010226', '008013456', {results: 1})
|
|
|
|
// client.departures('008010226', { duration: 5 })
|
2018-06-28 13:00:33 +02:00
|
|
|
// client.arrivals('8010226', {duration: 10, stationLines: true})
|
2018-03-12 22:43:50 +01:00
|
|
|
// client.locations('Magdeburg Hbf', {results: 2})
|
|
|
|
// client.locations('Kunstmuseum Kloster Unser Lieben Frauen Magdeburg', {results: 2})
|
2018-06-04 19:00:19 +02:00
|
|
|
// client.station('008010226') // Magdeburg-Neustadt
|
2018-03-12 22:43:50 +01:00
|
|
|
// client.nearby({
|
|
|
|
// type: 'location',
|
|
|
|
// latitude: 52.148842,
|
|
|
|
// longitude: 11.641705
|
|
|
|
// }, {distance: 200})
|
2018-03-16 17:28:48 +01:00
|
|
|
// client.radar({
|
|
|
|
// north: 52.148364,
|
|
|
|
// west: 11.600826,
|
|
|
|
// south: 52.108486,
|
|
|
|
// east: 11.651451
|
|
|
|
// }, {results: 10})
|
2018-02-26 22:14:11 +01:00
|
|
|
|
2018-03-13 21:04:42 +01:00
|
|
|
// .then(([journey]) => {
|
|
|
|
// const leg = journey.legs[0]
|
2018-06-29 15:05:29 +02:00
|
|
|
// return client.trip(leg.id, leg.line.name)
|
2018-03-13 21:04:42 +01:00
|
|
|
// })
|
|
|
|
|
2018-07-24 18:16:14 +02:00
|
|
|
// .then(([journey]) => {
|
|
|
|
// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true})
|
|
|
|
// })
|
|
|
|
|
2018-03-12 22:43:50 +01:00
|
|
|
.then(data => {
|
|
|
|
console.log(require('util').inspect(data, { depth: null }))
|
|
|
|
})
|
|
|
|
.catch(console.error)
|