From 68328dc90607ee4e72171ea8d25f67574faed8bb Mon Sep 17 00:00:00 2001 From: dtankdempse Date: Sun, 29 Sep 2024 09:27:29 -0600 Subject: [PATCH] Update scrape_streamed_su.php --- scrape_streamed_su.php | 45 +++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/scrape_streamed_su.php b/scrape_streamed_su.php index 014b49e..59ed5e8 100644 --- a/scrape_streamed_su.php +++ b/scrape_streamed_su.php @@ -202,30 +202,39 @@ function generateEPG($items) { $currentTime = time() - 3600; - foreach ($items as $item) { - $startTime = date('YmdHis', $currentTime) . ' +0000'; - $endTime = date('YmdHis', $currentTime + (48 * 3600)) . ' +0000'; + foreach ($items as $item) { + $startTime = date('YmdHis', $currentTime) . ' +0000'; + $endTime = date('YmdHis', $currentTime + (48 * 3600)) . ' +0000'; - $date = new DateTime(); - $date->setTimestamp($item['time'] / 1000); + $date = new DateTime(); + $date->setTimestamp($item['time'] / 1000); - $date->setTimezone(new DateTimeZone('America/Los_Angeles')); - $ptTime = $date->format('h:i A T'); + $date->setTimezone(new DateTimeZone('America/Los_Angeles')); + $ptTime = $date->format('h:i A T'); - $date->setTimezone(new DateTimeZone('America/Denver')); - $mtTime = $date->format('h:i A T'); + $date->setTimezone(new DateTimeZone('America/Denver')); + $mtTime = $date->format('h:i A T'); - $date->setTimezone(new DateTimeZone('America/New_York')); - $etTime = $date->format('h:i A T'); + $date->setTimezone(new DateTimeZone('America/New_York')); + $etTime = $date->format('h:i A T'); - $formattedDate = $date->format('m/d/Y'); - $description = "$ptTime / $mtTime / $etTime - ($formattedDate)"; + $date->setTimezone(new DateTimeZone('Europe/London')); + $gmtTime = $date->format('h:i A T'); - $epg .= ' ' . "\n"; - $epg .= ' ' . htmlspecialchars($item['title'] . ' - ' . $item['date']) . '' . "\n"; - $epg .= ' ' . htmlspecialchars($description) . '' . "\n"; - $epg .= ' ' . "\n"; - } + $date->setTimezone(new DateTimeZone('Europe/Berlin')); + $cetTime = $date->format('h:i A T'); + + $date->setTimezone(new DateTimeZone('Asia/Shanghai')); + $cstTime = $date->format('h:i A T'); + + $formattedDate = $date->format('m/d/Y'); + $description = "$ptTime / $mtTime / $etTime\n$gmtTime / $cetTime / $cstTime - ($formattedDate)"; + + $epg .= ' ' . "\n"; + $epg .= ' ' . htmlspecialchars($item['title'] . ' - ' . $item['date']) . '' . "\n"; + $epg .= ' ' . htmlspecialchars($description) . '' . "\n"; + $epg .= ' ' . "\n"; + } $epg .= '';