0.1.6 added the json part of Recorded calls :P
This commit is contained in:
27
main.go
27
main.go
@@ -330,6 +330,33 @@ func printData(data *Data) {
|
||||
if call.ExpectedDepartureTime != "" {
|
||||
fmt.Println("RecordedCall ExpectedDepartureTime:", call.ExpectedDepartureTime)
|
||||
}
|
||||
|
||||
jsonObjectRC := make(map[string]interface{})
|
||||
|
||||
if call.StopPointName != "" {
|
||||
jsonObjectRC["StopPointName"] = call.StopPointName
|
||||
}
|
||||
if call.ArrivalPlatformName != "" {
|
||||
jsonObjectRC["ArrivalPlatformName"] = call.ArrivalPlatformName
|
||||
}
|
||||
if call.DeparturePlatformName != "" {
|
||||
jsonObjectRC["DeparturePlatformName"] = call.DeparturePlatformName
|
||||
}
|
||||
if call.PredictionInaccurate != "" {
|
||||
jsonObjectRC["PredictionInaccurate"] = call.PredictionInaccurate
|
||||
}
|
||||
if call.Occupancy != "" {
|
||||
jsonObjectRC["Occupancy"] = call.Occupancy
|
||||
}
|
||||
|
||||
// Convert the JSON object to a JSON string
|
||||
jsonString, err := json.Marshal(jsonObjectRC)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Print the JSON string for the current journey
|
||||
fmt.Println(string(jsonString))
|
||||
}
|
||||
}
|
||||
for _, estimatedCall := range journey.EstimatedCalls {
|
||||
|
||||
Reference in New Issue
Block a user