From 7a5b51b8cf7c3a6256d8cd32e2588b6446ed2682 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 28 Apr 2015 19:28:49 +0200 Subject: [PATCH] Add CADBridge --- bridges/CADBridge.php | 61 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 bridges/CADBridge.php diff --git a/bridges/CADBridge.php b/bridges/CADBridge.php new file mode 100644 index 0000000..fd7c644 --- /dev/null +++ b/bridges/CADBridge.php @@ -0,0 +1,61 @@ +returnError('Could not request CAD.', 404); + $limit = 0; + foreach($html->find('item') as $element) { + if($limit < 3) { + $item = new \Item(); + $item->title = $element->find('title', 0)->innertext; + $item->uri = CADUrl($element->find('description', 0)->innertext); + if ($item->uri != 'notanurl') { + $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); + $item->content = ''; + $this->items[] = $item; + $limit++; + } + } + } + + } + + public function getName(){ + return 'CAD Bridge'; + } + + public function getURI(){ + return 'http://www.cad-comic.com/'; + } + + public function getCacheDuration(){ + return 3600*2; // 2 hours +// return 0; + } +}