-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.js
36 lines (33 loc) · 943 Bytes
/
example.js
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
'use strict'
const client = require('.')('hafas-client-example')
// Wien Westbahnhof to Salzburg Hbf
client.journeys('1291501', '8100002', {results: 1})
// client.departures('8100002', {duration: 1})
// client.arrivals('8100002', {duration: 10, linesOfStops: true})
// client.locations('Salzburg', {results: 2})
// client.stop('8100173') // Graz Hbf
// client.nearby({
// type: 'location',
// latitude: 47.812851,
// longitude: 13.045604
// }, {distance: 60})
// client.radar({
// north: 47.827203,
// west: 13.001261,
// south: 47.773278,
// east: 13.07562
// }, {results: 10})
// client.reachableFrom({
// type: 'location',
// id: '970053039',
// name: 'Graz, BILLA, Hauptplatz',
// latitude: 47.070656,
// longitude: 15.438002
// }, {
// when: new Date('2018-08-27T10:00:00+0200'),
// maxDuration: 20
// })
.then((data) => {
console.log(require('util').inspect(data, {depth: null, colors: true}))
})
.catch(console.error)