diff --git a/flake.nix b/flake.nix index 9db9116..90f37c0 100644 --- a/flake.nix +++ b/flake.nix @@ -16,7 +16,7 @@ vrnp-static = pkgs.buildGoModule { pname = "vrnp"; - version = "0.0.9"; + version = "0.0.10"; vendorHash = null; # For building the package, we use only the files not ignored by Git as inputs. diff --git a/main.go b/main.go index 096ae22..053ec7e 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,7 @@ import "time" // JSON unmarshaling types for departure monitor API type DMResponse struct { + DateTime DMDateTime `json:"dateTime"` DepartureList []DMDeparture `json:"departureList"` } @@ -213,6 +214,7 @@ func FetchDepartures(c EFAClient, stopId string) (DMResponse, error) { type Departures struct { Departures []Departure `json:"departures"` + ServerTime string `json:"serverTime"` } type Departure struct { @@ -273,7 +275,12 @@ func ParseDepartures(response DMResponse, allowedPlatform *string) (Departures, return cmp.Compare(a.Countdown, b.Countdown) }) - return Departures{ds}, nil + dt := response.DateTime + + return Departures{ + ds, + fmt.Sprintf("%02s:%02s", dt.Hour, dt.Minute), + }, nil } func main() {