A website to view arrival times for the NYC subway! Mirrored from https://github.com/gavinmorrow/sbwy sbwy.gavinmorrow.com/
subway gleam mta-nyct gtfs nyc
1

Configure Feed

Select the types of activity you want to include in your feed.

Update gen_schedule for it

Gavin Morrow (Jun 15, 2026, 5:35 PM EDT) 281b9bfe d6fa93e9

+27 -13
+27 -13
server/dev/gen_schedule.gleam
··· 7 7 const path = "src/subway_gleam/gtfs/st/schedule_sample" 8 8 9 9 const stops_prefix = "import subway_gleam/gtfs/st.{North, South, Stop, StopId} 10 + import subway_gleam/gtfs/st/route.{ 11 + A, B, C, D, E, F, FX, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N6X, N7, N7X, Q, 12 + R, S, Sf, Si, Sr, W, Z, 13 + } 14 + import subway_gleam/gtfs/st_extra.{ 15 + Bronx, Brooklyn, Manhattan, Queens, StatenIsland, 16 + } 10 17 11 18 import gleam/dict 12 19 import gleam/option.{None, Some} 20 + import gleam/set 21 + 22 + fn set(dict: dict.Dict(a, b)) -> set.Set(a) { 23 + dict |> dict.keys |> set.from_list 24 + } 13 25 " 14 26 15 27 const trips_prefix = "import subway_gleam/gtfs/st.{ ··· 42 54 } 43 55 " 44 56 45 - const stop_routes_prefix = "import subway_gleam/gtfs/st.{StopId} 46 - import subway_gleam/gtfs/st/route.{ 47 - A, B, C, D, E, F, FX, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N6X, N7, N7X, Q, 48 - R, S, Sf, Si, Sr, W, Z, 49 - } 57 + // See comment about stop_routes in st.parse 58 + // 59 + // const stop_routes_prefix = "import subway_gleam/gtfs/st.{StopId} 60 + // import subway_gleam/gtfs/st/route.{ 61 + // A, B, C, D, E, F, FX, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N6X, N7, N7X, Q, 62 + // R, S, Sf, Si, Sr, W, Z, 63 + // } 50 64 51 - import gleam/dict 52 - import gleam/set 65 + // import gleam/dict 66 + // import gleam/set 53 67 54 - fn set(dict: dict.Dict(a, b)) -> set.Set(a) { 55 - dict |> dict.keys |> set.from_list 56 - } 57 - " 68 + // fn set(dict: dict.Dict(a, b)) -> set.Set(a) { 69 + // dict |> dict.keys |> set.from_list 70 + // } 71 + // " 58 72 59 73 const transfers_prefix = "import subway_gleam/gtfs/st.{StopId, Transfer} 60 74 ··· 86 100 import subway_gleam/gtfs/st/schedule_sample/stops.{stops} 87 101 import subway_gleam/gtfs/st/schedule_sample/trips.{trips} 88 102 import subway_gleam/gtfs/st/schedule_sample/services.{services} 89 - import subway_gleam/gtfs/st/schedule_sample/stop_routes.{stop_routes} 90 103 import subway_gleam/gtfs/st/schedule_sample/transfers.{transfers} 91 104 import subway_gleam/gtfs/st/schedule_sample/routes.{routes} 92 105 ··· 96 109 stops: stops(), 97 110 trips: trips(), 98 111 services: services(), 99 - stop_routes: stop_routes(), 100 112 transfers: transfers(), 101 113 routes: routes(), 102 114 )) ··· 115 127 string.inspect(schedule.stops) 116 128 // The ShapeId constructor is opaque, so there's a helper func 117 129 |> string.replace(each: "ShapeId(", with: "shape_id(") 130 + |> string.replace(each: "Set(", with: "set(") 118 131 // |> string.replace(each: "StopId(", with: "stop_id(") 119 132 let assert Ok(Nil) = 120 133 simplifile.write( ··· 142 155 contents: services_prefix <> "pub fn services() {" <> services_str <> "}", 143 156 ) 144 157 // See comment about stop_routes in st.parse 158 + // 145 159 // let stop_routes_str = 146 160 // string.inspect(schedule.stop_routes) 147 161 // // The ShapeId constructor is opaque, so there's a helper func