diff --git a/p/oebb/example.js b/p/oebb/example.js new file mode 100644 index 00000000..9c656063 --- /dev/null +++ b/p/oebb/example.js @@ -0,0 +1,18 @@ +'use strict' + +const createClient = require('../..') +const oebbProfile = require('.') + +const client = createClient(oebbProfile) + +// Wien Westbahnhof to Salzburg Hbf +client.journeys('1291501', '8100002', {results: 1}) +// client.departures('8100002', {duration: 1}) +// client.locations('Salzburg', {results: 2}) +// client.nearby(47.812851, 13.045604, {distance: 60}) +// client.radar(47.827203, 13.001261, 47.773278, 13.07562, {results: 10}) + +.then((data) => { + console.log(require('util').inspect(data, {depth: null})) +}) +.catch(console.error) diff --git a/p/oebb/readme.md b/p/oebb/readme.md new file mode 100644 index 00000000..d57dcd08 --- /dev/null +++ b/p/oebb/readme.md @@ -0,0 +1,18 @@ +# ÖBB profile for `hafas-client` + +[*Österreichische Bundesbahnen (ÖBB)*](https://en.wikipedia.org/wiki/Austrian_Federal_Railways) is the largest Austrian long-distance public transport company. This profile adds *ÖBB*-specific customizations to `hafas-client`. Consider using [`oebb-hafas`](https://github.com/juliuste/oebb-hafas#oebb-hafas), to always get the customized client right away. + +## Usage + +```js +const createClient = require('hafas-client') +const oebbProfile = require('hafas-client/p/oebb') + +// create a client with DB profile +const client = createClient(oebbProfile) +``` + + +## Customisations + +- parses *ÖBB*-specific products (such as *RailJet*) diff --git a/readme.md b/readme.md index bc7e64a1..79d4ac59 100644 --- a/readme.md +++ b/readme.md @@ -4,6 +4,7 @@ - [Deutsche Bahn (DB)](https://en.wikipedia.org/wiki/Deutsche_Bahn) - [docs](p/db/readme.md) – [usage example](p/db/example.js) – [src](p/db/index.js) - [Berlin public transport (VBB)](https://en.wikipedia.org/wiki/Verkehrsverbund_Berlin-Brandenburg) - [docs](p/vbb/readme.md) – [usage example](p/vbb/example.js) – [src](p/vbb/index.js) +- [Österreichische Bundesbahnen (ÖBB)](https://en.wikipedia.org/wiki/Austrian_Federal_Railways) - [docs](p/oebb/readme.md) – [usage example](p/oebb/example.js) – [src](p/oebb/index.js) [![npm version](https://img.shields.io/npm/v/hafas-client.svg)](https://www.npmjs.com/package/hafas-client) [![build status](https://img.shields.io/travis/derhuerst/hafas-client.svg)](https://travis-ci.org/derhuerst/hafas-client)