From 06cddce688b83ac09c9204584ee2fa5b42443fff Mon Sep 17 00:00:00 2001 From: somini Date: Tue, 2 Nov 2021 00:36:14 +0000 Subject: [PATCH 1/2] [PanacheDigitalGames]: New Bridge Another blog without RSS, I don't know how they expect anyone to follow this. --- bridges/PanacheDigitalGamesBridge.php | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 bridges/PanacheDigitalGamesBridge.php diff --git a/bridges/PanacheDigitalGamesBridge.php b/bridges/PanacheDigitalGamesBridge.php new file mode 100644 index 00000000000..3a6d53dc303 --- /dev/null +++ b/bridges/PanacheDigitalGamesBridge.php @@ -0,0 +1,45 @@ +find('.news-item') as $element) { + $item = array(); + + $title = $element->find('.news-item-texts-title', 0); + $link = $element->find('.news-item-texts a', 0); + $timestamp = $element->find('.news-item-texts-date', 0); + + $item['title'] = $title->plaintext; + $item['uri'] = self::URI . $link->href; + $item['timestamp'] = strtotime($timestamp->plaintext); + + $image_html = $element->find('.news-item-thumbnail-image', 0); + if ($image_html) { + $image_strings = explode('\'', $image_html); + /* Debug::log('S: ' . count($image_strings) . '||' . implode('_ _', $image_strings)); */ + if ( count($image_strings) == 4) { + $item['content'] = ''; + } + } + + $this->items[] = $item; + } + } +} From 8be725ebf8632cca50f613bb675d6c2d2ff07641 Mon Sep 17 00:00:00 2001 From: somini Date: Thu, 4 Nov 2021 01:38:24 +0000 Subject: [PATCH 2/2] Appease phpcs --- bridges/PanacheDigitalGamesBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/PanacheDigitalGamesBridge.php b/bridges/PanacheDigitalGamesBridge.php index 3a6d53dc303..ba9640eff8a 100644 --- a/bridges/PanacheDigitalGamesBridge.php +++ b/bridges/PanacheDigitalGamesBridge.php @@ -34,7 +34,7 @@ public function collectData() { if ($image_html) { $image_strings = explode('\'', $image_html); /* Debug::log('S: ' . count($image_strings) . '||' . implode('_ _', $image_strings)); */ - if ( count($image_strings) == 4) { + if (count($image_strings) == 4) { $item['content'] = ''; } }