https://github.com/juliuste/zpcg
Client for the Montenegrin ŽPCG railway API.
https://github.com/juliuste/zpcg
library public-transport railway
Last synced: 8 months ago
JSON representation
Client for the Montenegrin ŽPCG railway API.
- Host: GitHub
- URL: https://github.com/juliuste/zpcg
- Owner: juliuste
- License: isc
- Created: 2018-05-26T16:50:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T07:38:56.000Z (about 6 years ago)
- Last Synced: 2025-01-25T07:45:52.644Z (over 1 year ago)
- Topics: library, public-transport, railway
- Language: JavaScript
- Size: 93.8 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# zpcg
JavaScript client for the Montenegrin 🇲🇪 [ŽPCG](https://www.zcg-prevoz.me/) railway API. Complies with the [friendly public transport format](https://github.com/public-transport/friendly-public-transport-format). Inofficial, using *ŽPCG* endpoints. Ask them for permission before using this module in production.
[](https://www.npmjs.com/package/zpcg)
[](https://travis-ci.org/juliuste/zpcg)
[](https://greenkeeper.io/)
[](https://david-dm.org/juliuste/zpcg)
[](license)
[](https://fptf.badges.juliustens.eu/link/juliuste/zpcg)
[](https://gitter.im/juliuste)
## Installation
```shell
npm install --save zpcg
```
## Usage
```javascript
const zpcg = require('zpcg')
```
This package contains data in the [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format) and provides the following methods:
- [`stations()`](docs/stations.md) to get a list of operated stations, such as `Podgorica`, `Bar` or `Belgrade`.
- [`journeys(origin, destination, date = new Date())`](docs/journeys.md) to get routes between stations. *Please note that the API doesn't yet support interchange connections.*
- [`journeyLeg(legId, departureDate)`](docs/journeyLeg.md) to get all passed stations and prices for a given journey leg.
## Contributing
If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit [the issues page](https://github.com/juliuste/zpcg/issues).