From 4f59e2441c8bf0138081e6db944b77af4e2a43fa Mon Sep 17 00:00:00 2001 From: Astalaseven Date: Mon, 16 Dec 2013 09:07:48 +0100 Subject: [PATCH] [new] Bridges for DTC and SDZ --- bridges/DansTonChatBridge.php | 42 ++++++++++++++++++++++++++++++++ bridges/OpenClassroomsBridge.php | 39 +++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 bridges/DansTonChatBridge.php create mode 100644 bridges/OpenClassroomsBridge.php diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php new file mode 100644 index 00000000..06ad5b2f --- /dev/null +++ b/bridges/DansTonChatBridge.php @@ -0,0 +1,42 @@ +returnError('Could not request DansTonChat.', 404); + + foreach($html->find('div.item') as $element) { + $item = new \Item(); + $item->uri = $element->find('a', 0)->href; + $item->title = 'DansTonChat '.$element->find('a', 1)->plaintext; +<<<<<<< HEAD +======= + //$item->content = $element->find('p.item-content', 0)->innertext; +>>>>>>> d194d02... [new] Bridges for DTC and SDZ + $item->content = $element->find('a', 0)->innertext; + $this->items[] = $item; + } + } + + public function getName(){ + return 'DansTonChat'; + } + + public function getURI(){ + return 'http://danstonchat.com'; + } + + public function getCacheDuration(){ + return 21600; // 6 hours + } +} diff --git a/bridges/OpenClassroomsBridge.php b/bridges/OpenClassroomsBridge.php new file mode 100644 index 00000000..d2d3c4ae --- /dev/null +++ b/bridges/OpenClassroomsBridge.php @@ -0,0 +1,39 @@ +returnError('Could not request OpenClassrooms.', 404); + + foreach($html->find('li.col6') as $element) { + $item = new \Item(); + $item->uri = 'http://fr.openclassrooms.com'.$element->find('a', 0)->href; + $item->title = $element->find('div.courses-content strong', 0)->innertext; + $item->content = $element->find('span.course-tags', 0)->innertext; + $this->items[] = $item; + } + } + + public function getName(){ + return 'OpenClassrooms'; + } + + public function getURI(){ + return 'http://fr.openclassrooms.com'; + } + + public function getCacheDuration(){ + return 21600; // 6 hours + } +}