From 6bb04d48ed80a328174e071f064c6336f1b01fe1 Mon Sep 17 00:00:00 2001 From: tillcash Date: Thu, 8 Feb 2024 00:03:25 +0530 Subject: [PATCH] [KilledbyMicrosoftBridge] New Bridge (#3961) --- bridges/KilledbyMicrosoftBridge.php | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 bridges/KilledbyMicrosoftBridge.php diff --git a/bridges/KilledbyMicrosoftBridge.php b/bridges/KilledbyMicrosoftBridge.php new file mode 100644 index 00000000..8779f0ae --- /dev/null +++ b/bridges/KilledbyMicrosoftBridge.php @@ -0,0 +1,61 @@ +formatTitle( + $service['name'], + $service['dateOpen'], + $service['dateClose'] + ); + + // Construct the content + $content = sprintf( + '

%s

Scheduled Closure: %s

', + $service['description'], + $service['dateClose'] + ); + + // Add the item to the feed + $this->items[] = [ + 'title' => $title, + 'uid' => $service['slug'], + 'uri' => $service['link'], + 'content' => $content + ]; + } + } + + private function formatTitle($name, $dateOpen, $dateClose) + { + // Extract years from dateOpen and dateClose + $yearOpen = date('Y', strtotime($dateOpen)); + $yearClose = date('Y', strtotime($dateClose)); + + // Format the title + return "{$name} ({$yearOpen} - {$yearClose})"; + } +}