-
-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathexample.js
More file actions
41 lines (33 loc) · 1.07 KB
/
example.js
File metadata and controls
41 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict'
const createClient = require('../../')
const dbbusradarnrwProfile = require('.')
const client = createClient(dbbusradarnrwProfile, 'hafas-client-example')
// Hagen Bauhaus to Schwerte Bahnhof
// returns hafas error PARSE
client.journeys('3307002', '3357026', {results: 1})
// .then(({journeys}) => {
// const leg = journeys[0].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})
// })
// client.departures('3307002', {duration: 60})
// client.arrivals('3307002', {duration: 30, linesOfStops: true})
// client.locations('Hagen Vorhalle')
// client.stop('3307002') // Hagen Bauhaus
// client.nearby({
// type: 'location',
// latitude: 51.38,
// longitude: 7.45
// }, {results: 1})
// client.radar({
// north: 51.5,
// west: 7.2,
// south: 51.2,
// east: 7.8
// }, {results: 10})
.then((data) => {
console.log(require('util').inspect(data, {depth: null, colors: true}))
}, console.error)