From b646afffff4da83394e90790b1e776e668d03488 Mon Sep 17 00:00:00 2001 From: dag Date: Tue, 22 Mar 2022 20:46:59 +0100 Subject: [PATCH] [ExecuteProgramBridge] Add new bridge for www.executeprogram.com (#2339) --- bridges/ExecuteProgramBridge.php | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 bridges/ExecuteProgramBridge.php diff --git a/bridges/ExecuteProgramBridge.php b/bridges/ExecuteProgramBridge.php new file mode 100755 index 00000000000..24342d1f647 --- /dev/null +++ b/bridges/ExecuteProgramBridge.php @@ -0,0 +1,38 @@ +posts as $post) { + $year = $post->date->year; + $month = $post->date->month; + $day = $post->date->day; + + $item = array(); + $item['uri'] = sprintf('https://www.executeprogram.com/blog/%s', $post->slug); + $item['title'] = $post->title; + $dateTime = \DateTime::createFromFormat('Y-m-d', $year . '-' . $month . '-' . $day); + $item['timestamp'] = $dateTime->format('U'); + $item['content'] = $post->body; + + $this->items[] = $item; + } + + usort($this->items, function ($a, $b) { + return $a['timestamp'] < $b['timestamp']; + }); + } + + public function getIcon() + { + return 'https://www.executeprogram.com/favicon.ico'; + } +}