Skip to content

Commit

Permalink
Update scrape_streamed_su.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dtankdempse authored Sep 29, 2024
1 parent a1c9759 commit 68328dc
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions scrape_streamed_su.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= ' <programme start="' . $startTime . '" stop="' . $endTime . '" channel="' . $item['epg'] . '">' . "\n";
$epg .= ' <title>' . htmlspecialchars($item['title'] . ' - ' . $item['date']) . '</title>' . "\n";
$epg .= ' <desc>' . htmlspecialchars($description) . '</desc>' . "\n";
$epg .= ' </programme>' . "\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 .= ' <programme start="' . $startTime . '" stop="' . $endTime . '" channel="' . $item['epg'] . '">' . "\n";
$epg .= ' <title>' . htmlspecialchars($item['title'] . ' - ' . $item['date']) . '</title>' . "\n";
$epg .= ' <desc>' . htmlspecialchars($description) . '</desc>' . "\n";
$epg .= ' </programme>' . "\n";
}

$epg .= '</tv>';

Expand Down

0 comments on commit 68328dc

Please sign in to comment.