trains

Notifications for the new MBTA trains. Probably no longer functional.

git clone https://code.pdelong.com/trains.git

 1package main
 2
 3// The URL to hit for the statuses of all trains returning only the
 4// information we care about.
 5const apiEndpoint = "https://api-v3.mbta.com/vehicles?filter[route]=Red,Orange,Green-B,Green-C,Green-D,Green-E&include=stop&fields[vehicle]=label,current_status,direction_id"
 6
 7// The lines the car could be on.
 8const (
 9	LineUnknown = iota
10	Red         = iota
11	Orange      = iota
12	GreenB      = iota
13	GreenC      = iota
14	GreenD      = iota
15	GreenE      = iota
16)
17
18// The directions a train could be headed in.
19const (
20	DirectionUnknown = iota
21	North            = iota
22	South            = iota
23	East             = iota
24	West             = iota
25)