From 9712d052b4a258fdc04fa8e6aaf898b6fdb3603f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jul 2015 18:43:15 +0200 Subject: [PATCH] Implementing TheOatMeal bridge fast with RSSExpander --- bridges/TheOatMealBridge.php | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bridges/TheOatMealBridge.php diff --git a/bridges/TheOatMealBridge.php b/bridges/TheOatMealBridge.php new file mode 100644 index 0000000..3e23f76 --- /dev/null +++ b/bridges/TheOatMealBridge.php @@ -0,0 +1,43 @@ +title = trim($newsItem->title); +// $this->message("browsing item ".var_export($newsItem, true)); + if(empty($newsItem->guid)) { + $item->uri = $newsItem->link; + } else { + $item->uri = $newsItem->guid; + } + // now load that uri from cache + $this->message("now loading page ".$item->uri); + $articlePage = str_get_html($this->get_cached($item->uri)); + + $content = $articlePage->find('#comic', 0); + if($content==null) { + $content = $articlePage->find('#blog'); + } + $item->content = $newsItem->description; + $item->name = $newsItem->author; + $item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem); + return $item; + } + public function getCacheDuration(){ + return 7200; // 2h hours + } +}