diff --git a/bridges/JapanExpoBridge.php b/bridges/JapanExpoBridge.php index 7ac1f8a..ea20592 100644 --- a/bridges/JapanExpoBridge.php +++ b/bridges/JapanExpoBridge.php @@ -1,5 +1,5 @@ maintainer = 'Ginko'; @@ -64,7 +64,10 @@ class JapanExpoBridge extends BridgeAbstract{ if ($fullcontent) { if ($count < 5) { - $article_html = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request JapanExpo: '.$url); + if($this->get_cached_time($url) <= strtotime('-24 hours')) + $this->remove_from_cache($url); + + $article_html = $this->get_cached($url) or $this->returnServerError('Could not request JapanExpo: '.$url); $header = $article_html->find('header.pageHeadBox', 0); $timestamp = strtotime($header->find('time', 0)->datetime); $title_html = $header->find('div.section', 0)->next_sibling(); diff --git a/bridges/KununuBridge.php b/bridges/KununuBridge.php index e81917d..c4c2fa0 100644 --- a/bridges/KununuBridge.php +++ b/bridges/KununuBridge.php @@ -1,5 +1,5 @@ maintainer = "logmanoriginal"; $this->name = "Kununu Bridge"; /* This will be replaced later! */ @@ -248,7 +248,10 @@ class KununuBridge extends BridgeAbstract{ */ private function extract_full_description($uri){ // Load full article - $html = $this->getSimpleHTMLDOM($uri); + if($this->get_cached_time($uri) <= strtotime('-24 hours')) + $this->remove_from_cache($uri); + + $html = $this->get_cached($uri); if($html === false) $this->returnServerError('Could not load full description!'); diff --git a/bridges/LichessBridge.php b/bridges/LichessBridge.php index 839b183..1a34005 100644 --- a/bridges/LichessBridge.php +++ b/bridges/LichessBridge.php @@ -1,6 +1,6 @@ getSimpleHTMLDOM($blog_post_uri); + if($this->get_cached_time($blog_post_uri) <= strtotime('-24 hours')) + $this->remove_from_cache($blog_post_uriuri); + + $blog_post_html = $this->get_cached($blog_post_uri); $blog_post_div = $blog_post_html->find('#lichess_blog', 0); $post_chapo = $blog_post_div->find('.shortlede', 0)->innertext; diff --git a/bridges/NumeramaBridge.php b/bridges/NumeramaBridge.php index d9ae083..132c1e6 100644 --- a/bridges/NumeramaBridge.php +++ b/bridges/NumeramaBridge.php @@ -1,5 +1,5 @@ find('pubDate', 0)->plaintext); $article_url = NumeramaStripCDATA($element->find('guid', 0)->plaintext); - $article_html = $this->getSimpleHTMLDOM($article_url) or $this->returnServerError('Could not request Numerama: '.$article_url); + if($this->get_cached_time($article_url) <= strtotime('-24 hours')) + $this->remove_from_cache($article_url); + + $article_html = $this->get_cached($article_url) or $this->returnServerError('Could not request Numerama: '.$article_url); $contents = $article_html->find('section[class=related-article]', 0)->innertext = ''; // remove related articles block $contents = ''; // add post picture $contents = $contents.$article_html->find('article[class=post-content]', 0)->innertext; // extract the post diff --git a/bridges/WordPressBridge.php b/bridges/WordPressBridge.php index 370b772..271d2cb 100644 --- a/bridges/WordPressBridge.php +++ b/bridges/WordPressBridge.php @@ -1,7 +1,7 @@ find('updated', 0)->innertext); } - $article_html = $this->getSimpleHTMLDOM($item['uri']); + if($this->get_cached_time($item['uri']) <= strtotime('-24 hours')) + $this->remove_from_cache($item['uri']); + + $article_html = $this->get_cached($item['uri']); // Attempt to find most common content div if(!isset($item['content'])){