From 6591d2be17d46c8575404737ff5f16a2658c19a0 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Fri, 24 Aug 2018 19:25:57 +0200 Subject: [PATCH] CMTA: adapt example code to hafas-client@3 :memo: --- p/cmta/example.js | 22 +++++++++++++++------- p/cmta/readme.md | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/p/cmta/example.js b/p/cmta/example.js index b47dfd30..3faaa1d4 100644 --- a/p/cmta/example.js +++ b/p/cmta/example.js @@ -3,23 +3,31 @@ const createClient = require('../..') const cmtaProfile = require('.') -const client = createClient(cmtaProfile) +const client = createClient(cmtaProfile, 'hafas-client-example') // Broadie Oaks to Domain client.journeys('000002370', '000005919', {results: 1, polylines: true}) // client.departures('000002370', {duration: 1}) +// client.arrivals('000002370', {duration: 10, stationLines: true}) // client.locations('Westgate', {results: 2}) -// client.location('000005534') // Downtown light rail station +// client.station('000005534') // Downtown light rail station // client.nearby({ -// type: 'location', -// latitude: 30.266222, -// longtitude: -97.746058 +// type: 'location', +// latitude: 30.266222, +// longtitude: -97.746058 // }, {distance: 60}) -// client.radar(30.240877, -97.804588, 30.225378, -97.786692, {results: 10}) +// client.radar({ +// north: 30.240877, +// west: -97.804588, +// south: 30.225378, +// east: -97.786692 +// }, {results: 10}) + // .then(([journey]) => { // const leg = journey.legs[0] -// return client.journeyLeg(leg.id, leg.line.name, {polyline: true}) +// return client.trip(leg.id, leg.line.name, {polyline: true}) // }) + .then((data) => { console.log(require('util').inspect(data, {depth: null})) }) diff --git a/p/cmta/readme.md b/p/cmta/readme.md index c21fc7c0..901f4336 100644 --- a/p/cmta/readme.md +++ b/p/cmta/readme.md @@ -9,7 +9,7 @@ const createClient = require('hafas-client') const cmtaProfile = require('hafas-client/p/cmta') // create a client with CMTA profile -const client = createClient(cmtaProfile) +const client = createClient(cmtaProfile, 'my-awesome-program') ```