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 + } +}