bratislava-transit
v1.0.1
Published
A wrapper for Bratislava OpenData API, MHD section
Downloads
5
Readme
bratislava-transit
let mhd = require(`bratislava-transit`)
let eMHaDe = new mhd(`toats' real key`)
const main = async () => {
console.log(eMHaDe.linePDF(525))
await eMHaDe.stops({name: "Hlavná stanica"}).then(console.log)
await eMHaDe.vehicle({line: 8}).then(console.log)
}
main()
A wrapper for Bratislava OpenData API /mhd/
section
Has @JSDoc
, with better documentation
Navigation
Getting started!
- First off, get an API key from Bratislava's OpenData https://opendata.bratislava.sk/page/openapi
- Then use
npm i bratislava-transit
and import it, like in example upper on the page (write it toindex.js
file) - Use
node index
to test it
Documentation
new <BratislavaMHD>(apiKey)
Constructor
- Params
apiKey
- String - A API key from Bratislava OpenData
async
<BratislavaMHD>.stops(options)
Function
- Params
options
- Object - Optional,
{
"stationStopID": 99999,
"stationID": 999,
"name": "Umňaukaná",
"tag": "099999"
}
- Returns - Object - Depends on
options
async
<BratislavaMHD>.vehicle(options)
Function
- Params
options
- Object - Optional,
{
"id": "7416", # vehicleNumber
"line": "98" # lineNumber
}
- Returns - Object - Depends on
options
<BratislavaMHD>.linePDF(lineNumber, year)
FunctionOnly works with Arriva Bratislava lines, DPB hasn't published PDFs of lines and ZSSK wants money for that.
Isn't an
async
Function
- Params
lineNumber
- Number - REQUIRED - Example525
year
- Number - Optional, Defaults to current year, Value must be between 2021-2031- Returns - String - a link to PDF from Arriva Bratislava Servers
i hope one day that we would be able to make apps built on transit here in bratislava