From ea3073e27f545fe5b1b5652c8bfcdef01640ebc9 Mon Sep 17 00:00:00 2001 From: Corentin Garcia Date: Mon, 20 Mar 2017 21:32:31 +0100 Subject: [PATCH] [RainbowSixSiegeBridge] Added bridge for Rainbow Six Siege blog --- bridges/RainbowSixSiegeBridge.php | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 bridges/RainbowSixSiegeBridge.php diff --git a/bridges/RainbowSixSiegeBridge.php b/bridges/RainbowSixSiegeBridge.php new file mode 100644 index 0000000..27f2e5b --- /dev/null +++ b/bridges/RainbowSixSiegeBridge.php @@ -0,0 +1,32 @@ +find('.comdev'); + + // Start at index 2 to remove highlighted articles + for($i = 2; $i < count($list); $i++){ + $article = $list[$i]; + + $item = array(); + + $uri = $article->find('h3 a', 0)->href; + $uri = 'https://rainbow6.ubisoft.com' . $uri; + $item['uri'] = $uri; + $item['title'] = $article->find('h3 a', 0)->plaintext; + $item['content'] = $article->find('a', 0)->innertext . '
' . $article->find('strong', 0)->plaintext; + $item['timestamp'] = strtotime($article->find('p', 0)->plaintext); + + $this->items[] = $item; + } + } +}