diff --git a/bahnplan.web/Pages/Index.cshtml b/bahnplan.web/Pages/Index.cshtml index aa58f33..a2f9071 100644 --- a/bahnplan.web/Pages/Index.cshtml +++ b/bahnplan.web/Pages/Index.cshtml @@ -87,10 +87,10 @@
-

Add trip from oeffisear.ch

+

Add trip from oeffisear.ch or öv.ztn.sh


- +

diff --git a/bahnplan.web/Pages/OEAPI.cshtml.cs b/bahnplan.web/Pages/OEAPI.cshtml.cs index b042cb5..b267c4f 100644 --- a/bahnplan.web/Pages/OEAPI.cshtml.cs +++ b/bahnplan.web/Pages/OEAPI.cshtml.cs @@ -21,13 +21,18 @@ namespace bahnplan.web.Pages { var link = Request.Query["link"].ToString(); var shortcode = link; + var oepage = "oeffisear.ch"; if (link.Contains("oeffisear.ch")) shortcode = link.Split("/#/").Last(); + else if (link.Contains("öv.ztn.sh") || link.Contains("xn--v-0ga.ztn.sh")) { + shortcode = link.Split("/#/").Last(); + oepage = "xn--v-0ga.ztn.sh"; + } var jid = shortcode.Split("/").Last(); shortcode = shortcode.Split("/").First(); using var db = new Database.DbConn(); - var response = new WebClient().DownloadString($"https://oeffisear.ch/journeys?{{\"reqId\":\"{shortcode}\"}}"); + var response = new WebClient().DownloadString($"https://{oepage}/journeys?{{\"reqId\":\"{shortcode}\"}}"); var parsed = OeapiResponse.FromJson(response);