From 7ef31185452e6eff5dac50a36c2e12e336dbd84f Mon Sep 17 00:00:00 2001 From: Peder Vatn Austad Date: Mon, 20 May 2024 16:17:52 +0200 Subject: [PATCH] 0.1.4 i know versining doesnt work like this but stfu also did sum testin --- main.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index eb390d4..b0c175c 100644 --- a/main.go +++ b/main.go @@ -130,7 +130,7 @@ type Data struct { func main() { // Fetch data from entur - resp, err := http.Get("https://api.entur.io/realtime/v1/rest/et?maxSize=5") + resp, err := http.Get("https://api.entur.io/realtime/v1/rest/et?maxSize=100") if err != nil { log.Fatal(err) } @@ -299,5 +299,24 @@ func printData(data *Data) { // Print the JSON string for the current journey fmt.Println(string(jsonString)) + + fmt.Println("Calls:") + for _, recordedCall := range journey.RecordedCalls { + for _, call := range recordedCall.RecordedCall { + if call.StopPointRef != "" { + fmt.Println("RecordedCall StopPointRef:", call.StopPointRef) + fmt.Println("RecordedCall Order:", call.Order) + } + } + } + for _, estimatedCall := range journey.EstimatedCalls { + for _, call := range estimatedCall.EstimatedCall { + if call.StopPointRef != "" { + fmt.Println("EstimatedCall StopPointRef:", call.StopPointRef) + fmt.Println("EstimatedCall Order:", call.Order) + } + } + } + } }