Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cptmeetkat/mmm-nexttrains
A plugin for MagicMirror to display trains arriving at Sydney train stations
https://github.com/cptmeetkat/mmm-nexttrains
gtfs magicmirror2 trains
Last synced: 2 days ago
JSON representation
A plugin for MagicMirror to display trains arriving at Sydney train stations
- Host: GitHub
- URL: https://github.com/cptmeetkat/mmm-nexttrains
- Owner: CptMeetKat
- License: mit
- Created: 2023-03-13T04:42:10.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-01T04:09:59.000Z (over 1 year ago)
- Last Synced: 2024-11-02T07:41:54.775Z (about 2 months ago)
- Topics: gtfs, magicmirror2, trains
- Language: JavaScript
- Homepage:
- Size: 167 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MMM-NextTrains
A MagicMirror module that displays when Sydney trains depart from a selected station, using raw GTFS data provided by the [NSW Transport API](https://opendata.transport.nsw.gov.au/).## Dependencies
* A [MagicMirror2](https://github.com/MichMich/MagicMirror) installation## Examples
![name-of-you-image](/screenshots/screenshot1.png)## Installation
### Linux
1. Clone this repository into your MagicMirror/modules directory.
2. ```sudo apt-get install libsqlite3-dev```
3. cd into MagicMirror/modules/NextTrains directory folder
4. ```npm install sqlite3 --build-from-source --sqlite=/usr```
5. ```sudo apt-get install sqlite3```
6. Create an account on [Transport NSW OpenData](https://opendata.transport.nsw.gov.au/)
7. Create an application and obtain an API key from [Transport NSW OpenData Applications](https://opendata.transport.nsw.gov.au/applications)
8. Make a copy of the sample server config file ```cp ./server.conf.sample ./server.conf```
9. Replace in `server.conf` with your api key
10. Insert the example configurations into your MagicMirror config file
### Windows
- No Windows version available yet
## Config
### Example configurations for config.js:
```
{
module: 'NextTrains',
position: 'bottom_right',
config: {
station: "Central Station",
maxTrains: 10
}
}
```### Config Options
| **Option** | **Description** |
| --- | --- |
| `station` | The name of the Sydney train station to monitor e.g. "Central Station" or "North Sydney Station"|
| `staticInterval` | How often the widget should refresh it's static data (in seconds), default is `1800`. |
| `realTimeInterval` | How often the widget should refresh it's realtime data (in seconds), default is `10`. |
| `maxTrains` | The maximum number of trains to display at a time, default is `10` |
| `delaysFormat` | Either `m`, `s` or `m:s` Determines what format to display delays in, default is `m` |
| `lateCriticalLimit` | After how many seconds to highlight a delay as critically late (red text), default is `600` |
| `etd` | Estimated time of departure - show departure time in time format, default is `false` |---