https://github.com/viniciusgerevini/sydney-realtime-transport
Responsible for getting information about Sydney's public transport position in realtime
https://github.com/viniciusgerevini/sydney-realtime-transport
Last synced: 2 months ago
JSON representation
Responsible for getting information about Sydney's public transport position in realtime
- Host: GitHub
- URL: https://github.com/viniciusgerevini/sydney-realtime-transport
- Owner: viniciusgerevini
- Created: 2018-04-26T09:40:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-27T08:40:53.000Z (about 7 years ago)
- Last Synced: 2025-02-03T16:47:36.734Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sydney public transport realtime
Part of [services communication](https://github.com/viniciusgerevini/services-communication) experiment
Responsible for getting information about Sydney's public transport position in realtime.
Fetches data from [Open Data NSW](https://opendata.transport.nsw.gov.au/)
*This service still under development*
## Set up
First you need to define the right configuration.
You can do it changing the configuration file located at `./configs/` or defining the following environment variables:```sh
export REALTIME_API_URL="Sydney transport realtime URL"
export REALTIME_API_KEY="your Open Data api key"
```To start services run:
```sh
make start
```## How it works
The communication between the services is done through the message bus.
While idle, the service won't send updates.
The service only starts updating when the following message is received:```json
{
"name": "TRANSPORT_LIVE_POSITION_REQUESTED",
"data": { "city": "AU_SYDNEY" }
}
```
If no message is received for 10 minutes the service becomes idle again.On update an message like the following example is sent:
```json
{
"name": "TRANSPORT_LIVE_POSITION_UPDATED",
"data": {
"city": "AU_SYDNEY",
"id": "1234acd",
"type": "bus",
"trip_id": "123",
"route_id": "abcd",
"position": {
"latitude": -30.0000000,
"longitude": -29.000000,
}
},
"version": 1,
"date": 1516097850519
}
```For now only `type` bus was implemented.