A Dazzle widget showing predictions for next arrivals at a TfL stop point, powered by Transport for London's Unified API.
- Copy
TflStopPointArrivals.js
to your dashboard project. - Add to your widgets and configure. For example:
'.source.js': | |
'IIFE': | |
'prefix': '()()' | |
'body': """ | |
(function () { | |
'use strict'; | |
$1 | |
})(); | |
""" |
"\\.js$": "#F1E05A", | |
"\\.php$": "#4F5D95", | |
"\\.html": "#E44B23", | |
"\\.css$": "#563D7C", | |
"\\.scss$": "#563D7C", | |
"\\.sass$": "#563D7C", | |
"\\.module\\.js$": "#1976D2", | |
"\\.controller\\.js$": "#1976D2", | |
"\\.service\\.js$": "#1976D2", | |
"\\.directive\\.js$": "#1976D2", |
A Dazzle widget showing predictions for next arrivals at a TfL stop point, powered by Transport for London's Unified API.
TflStopPointArrivals.js
to your dashboard project.See Financial-Times/github-label-sync for how-to use.
import {readFileLines} from '../utils/file.mjs'; | |
const NUMBER_REGEX = /\d+/g; | |
const extractNumbers = (line, lineIndex) => { | |
const numbers = []; | |
let match; | |
while ((match = NUMBER_REGEX.exec(line)) != null) { | |
numbers.push({ | |
number: match[0], |