mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
add docs for oebb
This commit is contained in:
parent
03b3d2c1c8
commit
4bbb3c6724
3 changed files with 37 additions and 0 deletions
18
p/oebb/example.js
Normal file
18
p/oebb/example.js
Normal file
|
@ -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)
|
18
p/oebb/readme.md
Normal file
18
p/oebb/readme.md
Normal file
|
@ -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*)
|
|
@ -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)
|
||||
|
||||
[](https://www.npmjs.com/package/hafas-client)
|
||||
[](https://travis-ci.org/derhuerst/hafas-client)
|
||||
|
|
Loading…
Add table
Reference in a new issue