From 02ab11121bb2c0c0da29cbf4d11173be39ea62bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=B5K=C3=B6ff?= <3207399+muekoeff@users.noreply.github.com> Date: Thu, 24 Mar 2022 22:26:19 +0100 Subject: [PATCH] [LaTeX3ProjectNewslettersBridge] New Bridge (#1589) --- bridges/LaTeX3ProjectNewslettersBridge.php | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 bridges/LaTeX3ProjectNewslettersBridge.php diff --git a/bridges/LaTeX3ProjectNewslettersBridge.php b/bridges/LaTeX3ProjectNewslettersBridge.php new file mode 100644 index 00000000..08e5fd85 --- /dev/null +++ b/bridges/LaTeX3ProjectNewslettersBridge.php @@ -0,0 +1,33 @@ +find('article tbody', 0); + + foreach($newsContainer->find('tr') as $row) { + $this->items[] = $this->collectArticle($row); + } + } + + private function collectArticle($element) { + $item = array(); + $item['uri'] = static::URI . $element->find('td', 1)->find('a', 0)->href; + $item['title'] = $element->find('td', 1)->find('a', 0)->plaintext; + $item['timestamp'] = DateTime::createFromFormat('Y/m/d', $element->find('td', 0)->plaintext)->getTimestamp(); + $item['content'] = $element->find('td', 2)->plaintext; + $item['author'] = 'LaTeX3 Project'; + return $item; + } + + public function getIcon(){ + return self::URI . '/favicon.ico'; + } +}