[bridges] Remove calls to get_cached and remove_from_cache
This commit is contained in:
parent
3a92a1e04b
commit
3a94956915
16 changed files with 0 additions and 36 deletions
|
@ -16,8 +16,6 @@ class CADBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function CADExtractContent($url) {
|
||||
if($this->get_cached_time($url) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($url);
|
||||
$html3 = $this->get_cached($url);
|
||||
|
||||
// The request might fail due to missing https support or wrong URL
|
||||
|
|
|
@ -17,8 +17,6 @@ class CommonDreamsBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function CommonDreamsExtractContent($url) {
|
||||
if($this->get_cached_time($url) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($url);
|
||||
$html3 = $this->get_cached($url);
|
||||
$text = $html3->find('div[class=field--type-text-with-summary]', 0)->innertext;
|
||||
$html3->clear();
|
||||
|
|
|
@ -28,7 +28,6 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
|
|||
$item = array();
|
||||
$item['author'] = $episode->find('a', 0)->text();
|
||||
$item['title'] = $episode->find('a', 0)->text();
|
||||
$item['timestamp'] = $this->get_cached_time($episode->find('a', 0)->getAttribute('href'));
|
||||
$textefiche=$htmlepisode->find('#textefiche', 0)->find('p',1);
|
||||
if (isset($textefiche)) {
|
||||
$item['content'] = $textefiche->text();
|
||||
|
|
|
@ -47,8 +47,6 @@ class DauphineLibereBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function ExtractContent($url) {
|
||||
if($this->get_cached_time($url) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($url);
|
||||
$html2 = $this->get_cached($url);
|
||||
$text = $html2->find('div.column', 0)->innertext;
|
||||
$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
|
||||
|
|
|
@ -42,8 +42,6 @@ class DeveloppezDotComBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function DeveloppezDotComExtractContent($url) {
|
||||
if($this->get_cached_time($url) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($url);
|
||||
$articleHTMLContent = $this->get_cached($url);
|
||||
$text = $this->convert_smart_quotes($articleHTMLContent->find('div.content', 0)->innertext);
|
||||
$text = utf8_encode($text);
|
||||
|
|
|
@ -86,8 +86,6 @@ class FuturaSciencesBridge extends FeedExpander {
|
|||
protected function parseItem($newsItem){
|
||||
$item = $this->parseRSS_2_0_Item($newsItem);
|
||||
$item['uri'] = str_replace('#xtor=RSS-8', '', $item['uri']);
|
||||
if($this->get_cached_time($item['uri']) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($item['uri']);
|
||||
$article = $this->get_cached($item['uri'])
|
||||
or $this->returnServerError('Could not request Futura-Sciences: ' . $item['uri']);
|
||||
$item['content'] = $this->ExtractArticleContent($article);
|
||||
|
|
|
@ -59,8 +59,6 @@ class JapanExpoBridge extends HttpCachingBridgeAbstract {
|
|||
if ($count >= 5) {
|
||||
break;
|
||||
}
|
||||
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);
|
||||
|
|
|
@ -224,9 +224,6 @@ class KununuBridge extends HttpCachingBridgeAbstract {
|
|||
*/
|
||||
private function extract_full_description($uri){
|
||||
// Load full article
|
||||
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!');
|
||||
|
|
|
@ -17,8 +17,6 @@ class LeJournalDuGeekBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function LeJournalDuGeekExtractContent($url) {
|
||||
if($this->get_cached_time($url) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($url);
|
||||
$articleHTMLContent = $this->get_cached($url);
|
||||
$text = $articleHTMLContent->find('div.post-content', 0)->innertext;
|
||||
|
||||
|
|
|
@ -12,8 +12,6 @@ class LeMondeInformatiqueBridge extends FeedExpander {
|
|||
|
||||
protected function parseItem($newsItem){
|
||||
$item = $this->parseRSS_1_0_Item($newsItem);
|
||||
if($this->get_cached_time($item['uri']) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($item['uri']);
|
||||
$article_html = $this->get_cached($item['uri'])
|
||||
or $this->returnServerError('Could not request LeMondeInformatique: ' . $item['uri']);
|
||||
$item['content'] = $this->CleanArticle($article_html->find('div#article', 0)->innertext);
|
||||
|
|
|
@ -17,9 +17,6 @@ class LichessBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function retrieve_lichess_post($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);
|
||||
|
||||
|
|
|
@ -17,8 +17,6 @@ class NextInpactBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function ExtractContent($url) {
|
||||
if($this->get_cached_time($url) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($url);
|
||||
$html2 = $this->get_cached($url);
|
||||
$text = '<p><em>'.$html2->find('span.sub_title', 0)->innertext.'</em></p>'
|
||||
.'<p><img src="'.$html2->find('div.container_main_image_article', 0)->find('img.dedicated',0)->src.'" alt="-" /></p>'
|
||||
|
|
|
@ -17,8 +17,6 @@ class NiceMatinBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function NiceMatinExtractContent($url) {
|
||||
if($this->get_cached_time($url) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($url);
|
||||
$html = $this->get_cached($url);
|
||||
if(!$html)
|
||||
return 'Could not acquire content from url: ' . $url . '!';
|
||||
|
|
|
@ -17,9 +17,6 @@ class NumeramaBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function ExtractContent($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 Numerama: '.$url);
|
||||
$contents = $article_html->find('section[class=related-article]', 0)->innertext = ''; // remove related articles block
|
||||
$contents = '<img alt="" style="max-width:300px;" src="'.$article_html->find('meta[property=og:image]', 0)->getAttribute('content').'">'; // add post picture
|
||||
|
|
|
@ -175,9 +175,6 @@ class WikipediaBridge extends HttpCachingBridgeAbstract {
|
|||
* Loads the full article from a given URI
|
||||
*/
|
||||
private function LoadFullArticle($uri){
|
||||
if($this->get_cached_time($uri) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($uri);
|
||||
|
||||
$content_html = $this->get_cached($uri);
|
||||
|
||||
if(!$content_html)
|
||||
|
|
|
@ -82,9 +82,6 @@ class WordPressBridge extends HttpCachingBridgeAbstract {
|
|||
$item['timestamp'] = strtotime($article->find('updated', 0)->innertext);
|
||||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue