From de8a3ce2ab70b829f334b8912ec13663013ea9db Mon Sep 17 00:00:00 2001 From: Pk11 Date: Mon, 14 Feb 2022 22:12:34 -0600 Subject: [PATCH] --- nextrip.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nextrip.php b/nextrip.php index 0691979..a68adc9 100644 --- a/nextrip.php +++ b/nextrip.php @@ -65,6 +65,8 @@
"北行", @@ -82,9 +84,16 @@ echo "

停留所{$stop}のNexTrip情報

"; echo '
'; foreach($json as $bus) { + if(strchr($bus->DepartureText, ':')) { + preg_match("/(\d+)000/", $bus->DepartureTime, $matches); + $time = date('H:i', $matches[1]); + } else { + $time = preg_replace("/ Min/", "分", $bus->DepartureText); + $time = preg_replace("/Due/", "今すぐ", $time); + } + echo '
'; - echo "

$bus->Route{$bus->Terminal}({$directions[$bus->RouteDirection]})
"; - echo "$bus->DepartureText

"; + echo "

$bus->Route{$bus->Terminal}({$directions[$bus->RouteDirection]})
$time

"; echo '
'; } echo '
';