From 3f8165207e242f17d38c699bb96710145ee56f84 Mon Sep 17 00:00:00 2001 From: Simon Alberny Date: Wed, 7 Jun 2023 22:36:51 +0200 Subject: [PATCH] Add RainLoopBridge (#3423) --- bridges/RainLoopBridge.php | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 bridges/RainLoopBridge.php diff --git a/bridges/RainLoopBridge.php b/bridges/RainLoopBridge.php new file mode 100644 index 00000000..81a3025e --- /dev/null +++ b/bridges/RainLoopBridge.php @@ -0,0 +1,40 @@ +find('.main-center', 0); + $elements = $mainContent->find('.row-fluid'); + foreach ($elements as $i => $element) { + if ($i === 0) { + continue; + } + + $titleEl = $element->find('.h3', 0); + $title = is_object($titleEl) ? $titleEl->plaintext : ''; + + $postUrl = self::URI . $title; + + $contentEl = $element->find('.span9', 0); + $content = is_object($contentEl) ? $contentEl->xmltext() : ''; + + $item = []; + $item['uri'] = $postUrl; + $item['title'] = $title; + $item['content'] = $content; + $item['timestamp'] = strtotime('now'); + + $this->items[] = $item; + } + } +}