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

29 lines
807 B
JavaScript
Raw Normal View History

2017-11-18 17:53:12 +01:00
'use strict'
const createClient = require('../..')
const vbbProfile = require('.')
const client = createClient(vbbProfile)
// Hauptbahnhof to Charlottenburg
2018-04-30 12:49:33 +02:00
client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
2017-11-18 17:53:12 +01:00
// client.departures('900000013102', {duration: 1})
// client.locations('Alexanderplatz', {results: 2})
2018-01-26 17:23:45 +01:00
// client.location('900000042101') // Spichernstr
2017-11-18 17:53:12 +01:00
// client.nearby(52.5137344, 13.4744798, {distance: 60})
// client.radar({
// north: 52.52411,
// west: 13.41002,
// south: 52.51942,
// east: 13.41709
// }, {results: 10})
2018-04-30 13:12:05 +02:00
// .then(([journey]) => {
// const leg = journey.legs[0]
// return client.journeyLeg(leg.id, leg.line.name, {polyline: true})
// })
2017-11-18 17:53:12 +01:00
.then((data) => {
console.log(require('util').inspect(data, {depth: null}))
})
.catch(console.error)