ZTravel/ZTravel.CLI/TestMain.cs

16 lines
548 B
C#
Raw Normal View History

2020-02-26 18:32:35 +01:00
using System;
2020-03-21 20:58:31 +01:00
using System.Linq;
using ZTravel.API.HAFAS;
2020-02-26 18:32:35 +01:00
namespace ZTravel.CLI {
public class TestMain {
private static void Main(string[] args) {
2020-03-21 20:58:31 +01:00
foreach (var dep in Endpoints.SvvEndpoint.GetDepartures("Salzburg Justizgebäude", 20).OrderBy(p => p.PlannedDeparture)) {
if (int.Parse(dep.Line) >= 20)
continue;
var delay = (dep.RealDeparture - dep.PlannedDeparture).TotalMinutes;
Console.WriteLine($"{dep.Platform} {dep.PlannedDeparture:HH:mm} ({(delay > 0 ? "+" : "")}{delay}) {dep.Line} {dep.Destination}");
2020-02-26 18:32:35 +01:00
}
}
}
}