From 8b572d61842e8c2aa07586f03d3bca0a37ad308a Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sun, 26 Aug 2018 18:35:27 +0200 Subject: [PATCH] profiles: enable reachableFrom --- p/bvg/example.js | 9 +++++++++ p/bvg/index.js | 4 +++- p/cmta/example.js | 9 +++++++++ p/cmta/index.js | 3 ++- p/db/example.js | 9 +++++++++ p/db/index.js | 3 ++- p/insa/index.js | 1 + p/nahsh/example.js | 9 +++++++++ p/nahsh/index.js | 3 ++- p/oebb/example.js | 10 ++++++++++ p/oebb/index.js | 3 ++- p/vbb/example.js | 9 +++++++++ p/vbb/index.js | 3 ++- 13 files changed, 69 insertions(+), 6 deletions(-) diff --git a/p/bvg/example.js b/p/bvg/example.js index 5a79930f..26b5e02c 100644 --- a/p/bvg/example.js +++ b/p/bvg/example.js @@ -22,6 +22,15 @@ client.journeys('900000003201', '900000024101', {results: 1, polylines: true}) // south: 52.51942, // east: 13.41709 // }, {results: 10}) +// client.reachableFrom({ +// type: 'location', +// address: '13353 Berlin-Wedding, Torfstr. 17', +// latitude: 52.541797, +// longitude: 13.350042 +// }, { +// when: new Date('2018-08-27T10:00:00+0200'), +// maxDuration: 10 +// }) // .then(([journey]) => { // const leg = journey.legs[0] diff --git a/p/bvg/index.js b/p/bvg/index.js index b3057a44..3db424c3 100644 --- a/p/bvg/index.js +++ b/p/bvg/index.js @@ -106,7 +106,9 @@ const bvgProfile = { formatStation, trip: true, - radar: true + radar: true, + refreshJourney: true, + reachableFrom: true } module.exports = bvgProfile diff --git a/p/cmta/example.js b/p/cmta/example.js index 6f996470..178fe6f5 100644 --- a/p/cmta/example.js +++ b/p/cmta/example.js @@ -22,6 +22,15 @@ client.journeys('000002370', '000005919', {results: 1, polylines: true}) // south: 30.225378, // east: -97.786692 // }, {results: 10}) +// client.reachableFrom({ +// type: 'location', +// address: '604 W 9TH ST, Austin, TX 78701', +// latitude: 30.272910, +// longitude: -97.747883 +// }, { +// when: new Date('2018-08-27T10:00:00+0200'), +// maxDuration: 15 +// }) // .then(([journey]) => { // const leg = journey.legs[0] diff --git a/p/cmta/index.js b/p/cmta/index.js index 9405cd14..fbb839a2 100644 --- a/p/cmta/index.js +++ b/p/cmta/index.js @@ -27,7 +27,8 @@ const cmtaProfile = { trip: true, radar: true, - refreshJourney: true + refreshJourney: true, + reachableFrom: true } module.exports = cmtaProfile diff --git a/p/db/example.js b/p/db/example.js index 1ca575b9..fe4d28f7 100644 --- a/p/db/example.js +++ b/p/db/example.js @@ -17,6 +17,15 @@ client.journeys('8011167', '8000261', {results: 1, tickets: true}) // latitude: 52.4751309, // longitude: 13.3656537 // }, {results: 1}) +// client.reachableFrom({ +// type: 'location', +// address: '13353 Berlin-Wedding, Torfstr. 17', +// latitude: 52.541797, +// longitude: 13.350042 +// }, { +// when: new Date('2018-08-27T10:00:00+0200'), +// maxDuration: 50 +// }) .then((data) => { console.log(require('util').inspect(data, {depth: null})) diff --git a/p/db/index.js b/p/db/index.js index 2e49a675..3954f7ba 100644 --- a/p/db/index.js +++ b/p/db/index.js @@ -319,7 +319,8 @@ const dbProfile = { formatStation, - trip: true // todo: #49 + trip: true, // todo: #49 + reachableFrom: true } module.exports = dbProfile diff --git a/p/insa/index.js b/p/insa/index.js index a6f65b43..441ee68b 100644 --- a/p/insa/index.js +++ b/p/insa/index.js @@ -28,6 +28,7 @@ const insaProfile = { trip: true, radar: true, refreshJourney: false + // todo: upgrade to version `1.13` in order to enable `reachableFrom: true` } module.exports = insaProfile; diff --git a/p/nahsh/example.js b/p/nahsh/example.js index 57a9aec5..16c285c9 100644 --- a/p/nahsh/example.js +++ b/p/nahsh/example.js @@ -18,6 +18,15 @@ client.journeys('8000103', '8000199', {results: 10, tickets: true}) // longitude: 10.116424 // }, {distance: 60}) // client.radar(54.4, 10.0, 54.2, 10.2, {results: 10}) +// client.reachableFrom({ +// type: 'location', +// address: 'Husum, Berliner Straße 80', +// latitude: 54.488995, +// longitude: 9.056263 +// }, { +// when: new Date('2018-08-27T10:00:00+0200'), +// maxDuration: 20 +// }) .then((data) => { console.log(require('util').inspect(data, {depth: null})) diff --git a/p/nahsh/index.js b/p/nahsh/index.js index 51a967dc..4e6c142b 100644 --- a/p/nahsh/index.js +++ b/p/nahsh/index.js @@ -104,7 +104,8 @@ const nahshProfile = { parseMovement: createParseMovement, trip: true, - radar: true // todo: see #34 + radar: true, // todo: see #34 + reachableFrom: true } module.exports = nahshProfile diff --git a/p/oebb/example.js b/p/oebb/example.js index f2c3ccdb..30e829c1 100644 --- a/p/oebb/example.js +++ b/p/oebb/example.js @@ -22,6 +22,16 @@ client.journeys('1291501', '8100002', {results: 1}) // 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})) diff --git a/p/oebb/index.js b/p/oebb/index.js index 2dd24b49..4e3e7f87 100644 --- a/p/oebb/index.js +++ b/p/oebb/index.js @@ -72,7 +72,8 @@ const oebbProfile = { parseMovement: createParseMovement, trip: true, - radar: true + radar: true, + reachableFrom: true } module.exports = oebbProfile diff --git a/p/vbb/example.js b/p/vbb/example.js index 5a79930f..26b5e02c 100644 --- a/p/vbb/example.js +++ b/p/vbb/example.js @@ -22,6 +22,15 @@ client.journeys('900000003201', '900000024101', {results: 1, polylines: true}) // south: 52.51942, // east: 13.41709 // }, {results: 10}) +// client.reachableFrom({ +// type: 'location', +// address: '13353 Berlin-Wedding, Torfstr. 17', +// latitude: 52.541797, +// longitude: 13.350042 +// }, { +// when: new Date('2018-08-27T10:00:00+0200'), +// maxDuration: 10 +// }) // .then(([journey]) => { // const leg = journey.legs[0] diff --git a/p/vbb/index.js b/p/vbb/index.js index 18909ded..fbcb1b81 100644 --- a/p/vbb/index.js +++ b/p/vbb/index.js @@ -143,7 +143,8 @@ const vbbProfile = { journeysNumF: false, trip: true, - radar: true + radar: true, + reachableFrom: true } module.exports = vbbProfile