Get Translink's alert information.
HTML JavaScript CoffeeScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
test
.editorconfig
.gitignore
.travis.yml
README.md
index.es2015.js
index.js
package.json

README.md

Build Status

Translink Alerts

Get status from Alerts & Advisories page.

Note that this is an UNOFFICIAL library.

Install

$ npm install https://github.com/ginpei/translink-alerts

Then you can use it via require('translink-alerts').

Usage

Do TransAlert.get() and check data which is passed through via callback function.

See an example.

var TransAlert = require('translink-alerts');

TransAlert.get(function(obj) {
    var storage = obj.data;
    for (var title in storage) {
        var data = storage[title];
        if (data.fine) {
            console.log('', data.title);
        }
        else {
            console.log('', data.title, ':', data.outline);
            data.description
                .split('\n')
                .forEach((line)=>console.log('\t', line));
        }
    }
});
✘ Bus : Service disruptions
         Due to construction on Ewen the following detours will apply 7:30am to 5:30pm
         104 Annacis Island Regular route to Ewen & Pembina then via Pembina, Dyke, Derwent then regular route.
         104 22nd Street Station Regular route to Ewen & Derwent then via Derwent, Dyke, Pembina, Ewen then regular route.
✔ SkyTrain
✔ SeaBus
✔ West Coast Express
✔ West Van Blue Bus
✘ Information Services : FareSaver Update.
         FareSavers do not expire and continue to be accepted on bus, SkyTrain, SeaBus and HandyDART. Customers are encouraged to use up their FareSavers and then switch to Compass.
✔ HandyDART