diff --git a/bridges/AcrimedBridge.php b/bridges/AcrimedBridge.php index 0042fc8..911abfc 100644 --- a/bridges/AcrimedBridge.php +++ b/bridges/AcrimedBridge.php @@ -4,6 +4,7 @@ class AcrimedBridge extends FeedExpander { const MAINTAINER = "qwertygc"; const NAME = "Acrimed Bridge"; const URI = "http://www.acrimed.org/"; + const CACHE_TIMEOUT = 4800; //2hours const DESCRIPTION = "Returns the newest articles."; public function collectData(){ @@ -22,7 +23,4 @@ class AcrimedBridge extends FeedExpander { return $item; } - public function getCacheDuration(){ - return 4800; // 2 hours - } } diff --git a/bridges/AllocineFRBridge.php b/bridges/AllocineFRBridge.php index 82405b0..23f139a 100644 --- a/bridges/AllocineFRBridge.php +++ b/bridges/AllocineFRBridge.php @@ -5,6 +5,7 @@ class AllocineFRBridge extends BridgeAbstract{ const MAINTAINER = "superbaillot.net"; const NAME = "Allo Cine Bridge"; const URI = "http://www.allocine.fr"; + const CACHE_TIMEOUT = 25200; // 7h const DESCRIPTION = "Bridge for allocine.fr"; const PARAMETERS = array( array( 'category'=>array( @@ -78,7 +79,4 @@ class AllocineFRBridge extends BridgeAbstract{ } } - public function getCacheDuration(){ - return 25200; // 7 hours - } } diff --git a/bridges/AnimeUltimeBridge.php b/bridges/AnimeUltimeBridge.php index 301475f..aed1e00 100644 --- a/bridges/AnimeUltimeBridge.php +++ b/bridges/AnimeUltimeBridge.php @@ -4,6 +4,7 @@ class AnimeUltimeBridge extends BridgeAbstract { const MAINTAINER = 'ORelio'; const NAME = 'Anime-Ultime'; const URI = 'http://www.anime-ultime.net/'; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = 'Returns the 10 newest releases posted on Anime-Ultime'; const PARAMETERS = array( array( 'type'=>array( @@ -115,8 +116,4 @@ class AnimeUltimeBridge extends BridgeAbstract { return 'Latest '.$typeFilter.' - Anime-Ultime Bridge'; } - public function getCacheDuration() { - return 3600*3; // 3 hours - } - } diff --git a/bridges/Arte7Bridge.php b/bridges/Arte7Bridge.php index 7080648..134dd9f 100644 --- a/bridges/Arte7Bridge.php +++ b/bridges/Arte7Bridge.php @@ -4,6 +4,7 @@ const MAINTAINER = "mitsukarenai"; const NAME = "Arte +7"; const URI = "http://www.arte.tv/"; + const CACHE_TIMEOUT = 1800; // 30min const DESCRIPTION = "Returns newest videos from ARTE +7"; const PARAMETERS = array( 'Catégorie (Français)' => array( @@ -86,7 +87,4 @@ } } - public function getCacheDuration(){ - return 1800; // 30 minutes - } } diff --git a/bridges/AskfmBridge.php b/bridges/AskfmBridge.php index a4c22df..0a4d967 100644 --- a/bridges/AskfmBridge.php +++ b/bridges/AskfmBridge.php @@ -4,6 +4,7 @@ class AskfmBridge extends BridgeAbstract{ const MAINTAINER = "az5he6ch"; const NAME = "Ask.fm Answers"; const URI = "http://ask.fm/"; + const CACHE_TIMEOUT = 300; //5 min const DESCRIPTION = "Returns answers from an Ask.fm user"; const PARAMETERS = array( 'Ask.fm username'=>array( @@ -48,9 +49,4 @@ class AskfmBridge extends BridgeAbstract{ public function getURI(){ return self::URI.urlencode($this->getInput('u')).'/answers/more?page=0'; } - - public function getCacheDuration(){ - return 300; // 5 minutes - } - } diff --git a/bridges/BandcampBridge.php b/bridges/BandcampBridge.php index 77b88e6..55c5b41 100644 --- a/bridges/BandcampBridge.php +++ b/bridges/BandcampBridge.php @@ -4,6 +4,7 @@ class BandcampBridge extends BridgeAbstract{ const MAINTAINER = "sebsauvage"; const NAME = "Bandcamp Tag"; const URI = "http://bandcamp.com/"; + const CACHE_TIMEOUT = 600; // 10min const DESCRIPTION = "New bandcamp release by tag"; const PARAMETERS = array( array( 'tag'=>array( @@ -39,8 +40,4 @@ class BandcampBridge extends BridgeAbstract{ public function getName(){ return $this->getInput('tag') .' - '.'Bandcamp Tag'; } - - public function getCacheDuration(){ - return 600; // 10 minutes - } } diff --git a/bridges/BastaBridge.php b/bridges/BastaBridge.php index be36662..55f68f6 100644 --- a/bridges/BastaBridge.php +++ b/bridges/BastaBridge.php @@ -3,6 +3,7 @@ class BastaBridge extends BridgeAbstract{ const MAINTAINER = "qwertygc"; const NAME = "Bastamag Bridge"; const URI = "http://www.bastamag.net/"; + const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = "Returns the newest articles."; public function collectData(){ @@ -27,9 +28,5 @@ class BastaBridge extends BridgeAbstract{ } } } - - public function getCacheDuration(){ - return 3600*2; // 2 hours - } } ?> diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php index 0392bed..ba93e9a 100644 --- a/bridges/BlaguesDeMerdeBridge.php +++ b/bridges/BlaguesDeMerdeBridge.php @@ -4,6 +4,7 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{ const MAINTAINER = "superbaillot.net"; const NAME = "Blagues De Merde"; const URI = "http://www.blaguesdemerde.fr/"; + const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = "Blagues De Merde"; @@ -28,9 +29,5 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{ } } } - - public function getCacheDuration(){ - return 7200; // 2h hours - } } ?> diff --git a/bridges/CADBridge.php b/bridges/CADBridge.php index b4e68d4..12071be 100644 --- a/bridges/CADBridge.php +++ b/bridges/CADBridge.php @@ -3,6 +3,7 @@ class CADBridge extends FeedExpander { const MAINTAINER = "nyutag"; const NAME = "CAD Bridge"; const URI = "http://www.cad-comic.com/"; + const CACHE_TIMEOUT = 7200; //2h const DESCRIPTION = "Returns the newest articles."; public function collectData(){ @@ -41,9 +42,5 @@ class CADBridge extends FeedExpander { return 'Daily comic not released yet'; return ''; } - - public function getCacheDuration(){ - return 3600*2; // 2 hours - } } ?> diff --git a/bridges/CNETBridge.php b/bridges/CNETBridge.php index 755033d..ea74203 100644 --- a/bridges/CNETBridge.php +++ b/bridges/CNETBridge.php @@ -4,6 +4,7 @@ class CNETBridge extends BridgeAbstract { const MAINTAINER = 'ORelio'; const NAME = 'CNET News'; const URI = 'http://www.cnet.com/'; + const CACHE_TIMEOUT = 1800; // 30min const DESCRIPTION = 'Returns the newest articles.
You may specify a topic found in some section URLs, else all topics are selected.'; const PARAMETERS = array( array( @@ -72,8 +73,4 @@ class CNETBridge extends BridgeAbstract { $topic=$this->getInput('topic'); return 'CNET News Bridge'.(empty($topic) ? '' : ' - '.$topic); } - - public function getCacheDuration() { - return 1800; // 30 minutes - } } diff --git a/bridges/CastorusBridge.php b/bridges/CastorusBridge.php index 2355542..18c083e 100644 --- a/bridges/CastorusBridge.php +++ b/bridges/CastorusBridge.php @@ -3,6 +3,7 @@ class CastorusBridge extends BridgeAbstract { const MAINTAINER = "logmanoriginal"; const NAME = "Castorus Bridge"; const URI = 'http://www.castorus.com'; + const CACHE_TIMEOUT = 600; // 10min const DESCRIPTION = "Returns the latest changes"; const PARAMETERS = array( @@ -107,8 +108,4 @@ class CastorusBridge extends BridgeAbstract { $this->items[] = $item; } } - - public function getCacheDuration(){ - return 600; // 10 minutes - } } diff --git a/bridges/CollegeDeFranceBridge.php b/bridges/CollegeDeFranceBridge.php index a6ae296..a8530d5 100644 --- a/bridges/CollegeDeFranceBridge.php +++ b/bridges/CollegeDeFranceBridge.php @@ -4,6 +4,7 @@ class CollegeDeFranceBridge extends BridgeAbstract{ const MAINTAINER = "pit-fgfjiudghdf"; const NAME = "CollegeDeFrance"; const URI = "http://www.college-de-france.fr/"; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = "Returns the latest audio and video from CollegeDeFrance"; public function collectData(){ @@ -66,8 +67,4 @@ class CollegeDeFranceBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 3600*3; // 3 hours - } } diff --git a/bridges/CopieDoubleBridge.php b/bridges/CopieDoubleBridge.php index aa04962..5d1310a 100644 --- a/bridges/CopieDoubleBridge.php +++ b/bridges/CopieDoubleBridge.php @@ -4,6 +4,7 @@ class CopieDoubleBridge extends BridgeAbstract{ const MAINTAINER = "superbaillot.net"; const NAME = "CopieDouble"; const URI = "http://www.copie-double.com/"; + const CACHE_TIMEOUT = 14400; // 4h const DESCRIPTION = "CopieDouble"; public function collectData(){ @@ -35,8 +36,4 @@ class CopieDoubleBridge extends BridgeAbstract{ } } } - - public function getCacheDuration(){ - return 14400; // 4 hours - } } diff --git a/bridges/CourrierInternationalBridge.php b/bridges/CourrierInternationalBridge.php index f91916f..c3f4793 100644 --- a/bridges/CourrierInternationalBridge.php +++ b/bridges/CourrierInternationalBridge.php @@ -4,6 +4,7 @@ class CourrierInternationalBridge extends BridgeAbstract{ const MAINTAINER = "teromene"; const NAME = "Courrier International Bridge"; const URI = "http://CourrierInternational.com/"; + const CACHE_TIMEOUT = 300; // 5 min const DESCRIPTION = "Courrier International bridge"; public function collectData(){ @@ -52,10 +53,6 @@ class CourrierInternationalBridge extends BridgeAbstract{ } - - public function getCacheDuration(){ - return 300; // 5 minutes - } } ?> diff --git a/bridges/CpasbienBridge.php b/bridges/CpasbienBridge.php index 10af594..c8669b3 100644 --- a/bridges/CpasbienBridge.php +++ b/bridges/CpasbienBridge.php @@ -4,6 +4,7 @@ class CpasbienBridge extends BridgeAbstract { const MAINTAINER = "lagaisse"; const NAME = "Cpasbien Bridge"; const URI = "http://www.cpasbien.io"; + const CACHE_TIMEOUT = 86400; // 24h const DESCRIPTION = "Returns latest torrents from a request query"; const PARAMETERS = array( array( @@ -49,8 +50,4 @@ class CpasbienBridge extends BridgeAbstract { public function getName(){ return $this->getInput('q').' : '.self::NAME; } - - public function getCacheDuration(){ - return 60*60*24; // 24 hours - } } diff --git a/bridges/CryptomeBridge.php b/bridges/CryptomeBridge.php index e58607a..e497eae 100644 --- a/bridges/CryptomeBridge.php +++ b/bridges/CryptomeBridge.php @@ -4,6 +4,7 @@ class CryptomeBridge extends BridgeAbstract{ const MAINTAINER = "BoboTiG"; const NAME = "Cryptome"; const URI = "https://cryptome.org/"; + const CACHE_TIMEOUT = 21600; //6h const DESCRIPTION = "Returns the N most recent documents."; const PARAMETERS = array( array( @@ -35,8 +36,4 @@ class CryptomeBridge extends BridgeAbstract{ break; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/DailymotionBridge.php b/bridges/DailymotionBridge.php index 8e639fe..4f49618 100644 --- a/bridges/DailymotionBridge.php +++ b/bridges/DailymotionBridge.php @@ -4,6 +4,7 @@ class DailymotionBridge extends BridgeAbstract{ const MAINTAINER = "mitsukarenai"; const NAME = "Dailymotion Bridge"; const URI = "https://www.dailymotion.com/"; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = "Returns the 5 newest videos by username/playlist or search"; const PARAMETERS = array ( @@ -110,8 +111,4 @@ class DailymotionBridge extends BridgeAbstract{ } return $uri; } - - public function getCacheDuration(){ - return 3600*3; // 3 hours - } } diff --git a/bridges/DanbooruBridge.php b/bridges/DanbooruBridge.php index 9f0a8c6..609d55a 100644 --- a/bridges/DanbooruBridge.php +++ b/bridges/DanbooruBridge.php @@ -4,6 +4,7 @@ class DanbooruBridge extends BridgeAbstract{ const MAINTAINER = "mitsukarenai"; const NAME = "Danbooru"; const URI = "http://donmai.us/"; + const CACHE_TIMEOUT = 1800; // 30min const DESCRIPTION = "Returns images from given page"; const PARAMETERS = array( @@ -47,8 +48,4 @@ class DanbooruBridge extends BridgeAbstract{ $this->items[] = $this->getItemFromElement($element); } } - - public function getCacheDuration(){ - return 1800; // 30 minutes - } } diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php index 30849b4..6081310 100644 --- a/bridges/DansTonChatBridge.php +++ b/bridges/DansTonChatBridge.php @@ -4,6 +4,7 @@ class DansTonChatBridge extends BridgeAbstract{ const MAINTAINER = "Astalaseven"; const NAME = "DansTonChat Bridge"; const URI = "http://danstonchat.com/"; + const CACHE_TIMEOUT = 21600; //6h const DESCRIPTION = "Returns latest quotes from DansTonChat."; public function collectData(){ @@ -19,8 +20,4 @@ class DansTonChatBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/DauphineLibereBridge.php b/bridges/DauphineLibereBridge.php index be768ae..e2d38fb 100644 --- a/bridges/DauphineLibereBridge.php +++ b/bridges/DauphineLibereBridge.php @@ -4,6 +4,7 @@ class DauphineLibereBridge extends FeedExpander { const MAINTAINER = "qwertygc"; const NAME = "Dauphine Bridge"; const URI = "http://www.ledauphine.com/"; + const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = "Returns the newest articles."; const PARAMETERS = array( array( @@ -52,9 +53,5 @@ class DauphineLibereBridge extends FeedExpander { $text = preg_replace('@]*?>.*?@si', '', $text); return $text; } - - public function getCacheDuration(){ - return 3600*2; // 2 hours - } } ?> diff --git a/bridges/DemoBridge.php b/bridges/DemoBridge.php index a01d15f..89a32ea 100644 --- a/bridges/DemoBridge.php +++ b/bridges/DemoBridge.php @@ -46,8 +46,4 @@ class DemoBridge extends BridgeAbstract{ $this->items[] = $item; } - - public function getCacheDuration(){ - return 00; // 1 hour - } } diff --git a/bridges/DeveloppezDotComBridge.php b/bridges/DeveloppezDotComBridge.php index 4804935..dbf8514 100644 --- a/bridges/DeveloppezDotComBridge.php +++ b/bridges/DeveloppezDotComBridge.php @@ -4,6 +4,7 @@ class DeveloppezDotComBridge extends FeedExpander { const MAINTAINER = "polopollo"; const NAME = "Developpez.com Actus (FR)"; const URI = "http://www.developpez.com/"; + const CACHE_TIMEOUT = 1800; // 30min const DESCRIPTION = "Returns the 15 newest posts from DeveloppezDotCom (full text)."; public function collectData(){ @@ -47,8 +48,4 @@ class DeveloppezDotComBridge extends FeedExpander { $text = utf8_encode($text); return trim($text); } - - public function getCacheDuration(){ - return 1800; // 30min - } } diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php index ba5a042..6257a00 100644 --- a/bridges/DilbertBridge.php +++ b/bridges/DilbertBridge.php @@ -4,6 +4,7 @@ class DilbertBridge extends BridgeAbstract { const MAINTAINER = 'kranack'; const NAME = 'Dilbert Daily Strip'; const URI = 'http://dilbert.com'; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = 'The Unofficial Dilbert Daily Comic Strip'; public function collectData(){ @@ -31,9 +32,5 @@ class DilbertBridge extends BridgeAbstract { $this->items[] = $item; } } - - public function getCacheDuration() { - return 21600; // 6 hours - } } ?> diff --git a/bridges/DuckDuckGoBridge.php b/bridges/DuckDuckGoBridge.php index 25ec859..480deb9 100644 --- a/bridges/DuckDuckGoBridge.php +++ b/bridges/DuckDuckGoBridge.php @@ -4,6 +4,7 @@ class DuckDuckGoBridge extends BridgeAbstract{ const MAINTAINER = "Astalaseven"; const NAME = "DuckDuckGo"; const URI = "https://duckduckgo.com/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns most recent results from DuckDuckGo."; const PARAMETERS = array( array( @@ -24,8 +25,4 @@ class DuckDuckGoBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/EliteDangerousGalnetBridge.php b/bridges/EliteDangerousGalnetBridge.php index 09d3770..bf76102 100644 --- a/bridges/EliteDangerousGalnetBridge.php +++ b/bridges/EliteDangerousGalnetBridge.php @@ -4,6 +4,7 @@ class EliteDangerousGalnetBridge extends BridgeAbstract const MAINTAINER = "corenting"; const NAME = "Elite: Dangerous Galnet"; const URI = "https://community.elitedangerous.com/galnet/"; + const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = "Returns the latest page of news from Galnet"; public function collectData() @@ -31,9 +32,4 @@ class EliteDangerousGalnetBridge extends BridgeAbstract $this->items[] = $item; } } - - public function getCacheDuration() - { - return 3600 * 2; // 2 hours - } } diff --git a/bridges/ElsevierBridge.php b/bridges/ElsevierBridge.php index 8905a9e..8e7580e 100644 --- a/bridges/ElsevierBridge.php +++ b/bridges/ElsevierBridge.php @@ -3,6 +3,7 @@ class ElsevierBridge extends BridgeAbstract{ const MAINTAINER = 'Pierre Mazière'; const NAME = 'Elsevier journals recent articles'; const URI = 'http://www.journals.elsevier.com/'; + const CACHE_TIMEOUT = 43200; //12h const DESCRIPTION = 'Returns the recent articles published in Elsevier journals'; const PARAMETERS = array( array( @@ -69,9 +70,5 @@ class ElsevierBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 43200; // 12h - } } ?> diff --git a/bridges/EstCeQuonMetEnProdBridge.php b/bridges/EstCeQuonMetEnProdBridge.php index b4f94b8..fdb99b4 100644 --- a/bridges/EstCeQuonMetEnProdBridge.php +++ b/bridges/EstCeQuonMetEnProdBridge.php @@ -4,6 +4,7 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract { const MAINTAINER = 'ORelio'; const NAME = 'Est-ce qu\'on met en prod aujourd\'hui ?'; const URI = 'https://www.estcequonmetenprodaujourdhui.info/'; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = 'Should we put a website in production today? (French)'; public function collectData(){ @@ -25,9 +26,5 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract { $item['content'] = str_replace('src="/', 'src="'.$this->getURI(), trim(ExtractFromDelimiters($html->outertext, '', '

'))); $this->items[] = $item; } - - public function getCacheDuration() { - return 21600; // 6 hours - } } ?> diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php index 90b7360..c595373 100644 --- a/bridges/FacebookBridge.php +++ b/bridges/FacebookBridge.php @@ -4,6 +4,7 @@ class FacebookBridge extends BridgeAbstract{ const MAINTAINER = "teromene"; const NAME = "Facebook"; const URI = "https://www.facebook.com/"; + const CACHE_TIMEOUT = 300; // 5min const DESCRIPTION = "Input a page title or a profile log. For a profile log, please insert the parameter as follow : myExamplePage/132621766841117"; const PARAMETERS =array( array( @@ -206,8 +207,4 @@ class FacebookBridge extends BridgeAbstract{ public function getName() { return (isset($this->authorName) ? $this->authorName.' - ' : '').'Facebook Bridge'; } - - public function getCacheDuration() { - return 300; // 5 minutes - } } diff --git a/bridges/FierPandaBridge.php b/bridges/FierPandaBridge.php index b2e9d9c..b6c49d1 100644 --- a/bridges/FierPandaBridge.php +++ b/bridges/FierPandaBridge.php @@ -4,6 +4,7 @@ class FierPandaBridge extends BridgeAbstract { const MAINTAINER = "snroki"; const NAME = "Fier Panda Bridge"; const URI = "http://www.fier-panda.fr/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns latest articles from Fier Panda."; public function collectData(){ @@ -19,8 +20,4 @@ class FierPandaBridge extends BridgeAbstract { $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/FlickrExploreBridge.php b/bridges/FlickrExploreBridge.php index f35333f..46d330d 100644 --- a/bridges/FlickrExploreBridge.php +++ b/bridges/FlickrExploreBridge.php @@ -4,6 +4,7 @@ class FlickrExploreBridge extends BridgeAbstract{ const MAINTAINER = "sebsauvage"; const NAME = "Flickr Explore"; const URI = "https://www.flickr.com/"; + const CACHE_TIMEOUT = 21600; // 6 const DESCRIPTION = "Returns the latest interesting images from Flickr"; public function collectData(){ @@ -38,8 +39,4 @@ class FlickrExploreBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/FlickrTagBridge.php b/bridges/FlickrTagBridge.php index 8b3f1b2..3b97c66 100644 --- a/bridges/FlickrTagBridge.php +++ b/bridges/FlickrTagBridge.php @@ -4,6 +4,7 @@ class FlickrTagBridge extends BridgeAbstract{ const MAINTAINER = "erwang"; const NAME = "Flickr TagUser"; const URI = "http://www.flickr.com/"; + const CACHE_TIMEOUT = 21600; //6h const DESCRIPTION = "Returns the tagged or user images from Flickr"; const PARAMETERS = array( @@ -43,9 +44,5 @@ class FlickrTagBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/FourchanBridge.php b/bridges/FourchanBridge.php index 3b6d105..9895cc3 100644 --- a/bridges/FourchanBridge.php +++ b/bridges/FourchanBridge.php @@ -4,6 +4,7 @@ class FourchanBridge extends BridgeAbstract{ const MAINTAINER = "mitsukarenai"; const NAME = "4chan"; const URI = "https://boards.4chan.org/"; + const CACHE_TIMEOUT = 300; // 5min const DESCRIPTION = "Returns posts from the specified thread"; const PARAMETERS = array( array( @@ -64,8 +65,4 @@ class FourchanBridge extends BridgeAbstract{ } $this->items = array_reverse($this->items); } - - public function getCacheDuration(){ - return 300; // 5min - } } diff --git a/bridges/GBAtempBridge.php b/bridges/GBAtempBridge.php index 0950dc3..d271cd9 100644 --- a/bridges/GBAtempBridge.php +++ b/bridges/GBAtempBridge.php @@ -121,9 +121,4 @@ class GBAtempBridge extends BridgeAbstract { ); return 'GBAtemp '.$type.' Bridge'; } - - public function getCacheDuration() { - return ($this->filter === 'Forum') ? 300 : 3600; // 5 minutes / 1 hour - } - } diff --git a/bridges/GiphyBridge.php b/bridges/GiphyBridge.php index dcdff8b..9498141 100644 --- a/bridges/GiphyBridge.php +++ b/bridges/GiphyBridge.php @@ -6,6 +6,7 @@ class GiphyBridge extends BridgeAbstract{ const MAINTAINER = "kraoc"; const NAME = "Giphy Bridge"; const URI = "http://giphy.com/"; + const CACHE_TIMEOUT = 300; //5min const DESCRIPTION = "Bridge for giphy.com"; const PARAMETERS = array( array( @@ -67,8 +68,4 @@ class GiphyBridge extends BridgeAbstract{ } } } - - public function getCacheDuration(){ - return 300; // 5 minutes - } } diff --git a/bridges/GithubIssueBridge.php b/bridges/GithubIssueBridge.php index a8a7171..81c1625 100644 --- a/bridges/GithubIssueBridge.php +++ b/bridges/GithubIssueBridge.php @@ -4,6 +4,7 @@ class GithubIssueBridge extends BridgeAbstract{ const MAINTAINER = 'Pierre Mazière'; const NAME = 'Github Issue'; const URI = 'https://github.com/'; + const CACHE_TIMEOUT = 600; // 10min const DESCRIPTION = 'Returns the issues or comments of an issue of a github project'; const PARAMETERS=array( @@ -152,7 +153,7 @@ class GithubIssueBridge extends BridgeAbstract{ if($this->getInput('c')){ $uri=static::URI.$this->getInput('u').'/'.$this->getInput('p').'/issues/'.$issueNbr; - $issue=$this->getSimpleHTMLDOMCached($uri,1800); + $issue=$this->getSimpleHTMLDOMCached($uri,static::CACHE_TIMEOUT); if($issue){ $this->items=array_merge($this->items,$this->extractIssueComments($issue)); continue; @@ -186,8 +187,4 @@ class GithubIssueBridge extends BridgeAbstract{ $item['title']=preg_replace('/\s+/',' ',$item['title']); }); } - - public function getCacheDuration(){ - return 600; // ten minutes - } } diff --git a/bridges/GizmodoBridge.php b/bridges/GizmodoBridge.php index 0fc80a5..3879c47 100644 --- a/bridges/GizmodoBridge.php +++ b/bridges/GizmodoBridge.php @@ -4,6 +4,7 @@ class GizmodoBridge extends FeedExpander { const MAINTAINER = "polopollo"; const NAME = "Gizmodo"; const URI = "http://gizmodo.com/"; + const CACHE_TIMEOUT = 1800; // 30min const DESCRIPTION = "Returns the newest posts from Gizmodo (full text)."; protected function parseItem($item){ @@ -28,8 +29,4 @@ class GizmodoBridge extends FeedExpander { public function collectData(){ $this->collectExpandableDatas('http://feeds.gawker.com/gizmodo/full'); } - - public function getCacheDuration(){ - return 1800; // 30min - } } diff --git a/bridges/GooglePlusPostBridge.php b/bridges/GooglePlusPostBridge.php index b86151d..214911d 100644 --- a/bridges/GooglePlusPostBridge.php +++ b/bridges/GooglePlusPostBridge.php @@ -7,6 +7,7 @@ class GooglePlusPostBridge extends BridgeAbstract const MAINTAINER = "Grummfy"; const NAME = "Google Plus Post Bridge"; const URI = "https://plus.google.com/"; + const CACHE_TIMEOUT = 600; //10min const DESCRIPTION = "Returns user public post (without API)."; const PARAMETERS = array( array( @@ -109,9 +110,4 @@ class GooglePlusPostBridge extends BridgeAbstract { return $this->_url ?: self::URI; } - - public function getCacheDuration() - { - return 1; // 600; // 10 minutes - } } diff --git a/bridges/GoogleSearchBridge.php b/bridges/GoogleSearchBridge.php index 9c3724f..0619acf 100644 --- a/bridges/GoogleSearchBridge.php +++ b/bridges/GoogleSearchBridge.php @@ -12,6 +12,7 @@ class GoogleSearchBridge extends BridgeAbstract{ const MAINTAINER = "sebsauvage"; const NAME = "Google search"; const URI = "https://www.google.com/"; + const CACHE_TIMEOUT = 1800; // 30min const DESCRIPTION = "Returns most recent results from Google search."; const PARAMETERS = array( array( @@ -50,8 +51,4 @@ class GoogleSearchBridge extends BridgeAbstract{ public function getName(){ return $this->getInput('q') .' - Google search'; } - - public function getCacheDuration(){ - return 1800; // 30 minutes - } } diff --git a/bridges/HDWallpapersBridge.php b/bridges/HDWallpapersBridge.php index bfa4979..9733af9 100644 --- a/bridges/HDWallpapersBridge.php +++ b/bridges/HDWallpapersBridge.php @@ -3,6 +3,7 @@ class HDWallpapersBridge extends BridgeAbstract { const MAINTAINER = "nel50n"; const NAME = "HD Wallpapers Bridge"; const URI = "http://www.hdwallpapers.in/"; + const CACHE_TIMEOUT = 43200; //12h const DESCRIPTION = "Returns the latests wallpapers from HDWallpapers"; const PARAMETERS = array( array( @@ -58,8 +59,4 @@ class HDWallpapersBridge extends BridgeAbstract { public function getName(){ return 'HDWallpapers - '.str_replace(['__', '_'], [' & ', ' '], $this->getInput('c')).' ['.$this->getInput('r').']'; } - - public function getCacheDuration(){ - return 43200; // 12 hours - } } diff --git a/bridges/HentaiHavenBridge.php b/bridges/HentaiHavenBridge.php index 2732560..2bab505 100644 --- a/bridges/HentaiHavenBridge.php +++ b/bridges/HentaiHavenBridge.php @@ -4,6 +4,7 @@ class HentaiHavenBridge extends BridgeAbstract{ const MAINTAINER = "albirew"; const NAME = "Hentai Haven"; const URI = "http://hentaihaven.org/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns releases from Hentai Haven"; public function collectData(){ @@ -19,8 +20,4 @@ class HentaiHavenBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/IdenticaBridge.php b/bridges/IdenticaBridge.php index 200634e..0ee1e28 100644 --- a/bridges/IdenticaBridge.php +++ b/bridges/IdenticaBridge.php @@ -4,6 +4,7 @@ class IdenticaBridge extends BridgeAbstract{ const MAINTAINER = "mitsukarenai"; const NAME = "Identica Bridge"; const URI = "https://identi.ca/"; + const CACHE_TIMEOUT = 300; // 5min const DESCRIPTION = "Returns user timelines"; const PARAMETERS = array( array( @@ -34,8 +35,4 @@ class IdenticaBridge extends BridgeAbstract{ public function getURI(){ return self::URI.urlencode($this->getInput('u')); } - - public function getCacheDuration(){ - return 300; // 5 minutes - } } diff --git a/bridges/IsoHuntBridge.php b/bridges/IsoHuntBridge.php index 4c4b268..72d0a03 100644 --- a/bridges/IsoHuntBridge.php +++ b/bridges/IsoHuntBridge.php @@ -3,6 +3,7 @@ class IsoHuntBridge extends BridgeAbstract{ const MAINTAINER = 'logmanoriginal'; const NAME = 'isoHunt Bridge'; const URI = 'https://isohunt.to/'; + const CACHE_TIMEOUT = 300; //5min const DESCRIPTION = 'Returns the latest results by category or search result'; const PARAMETERS = array( @@ -199,10 +200,6 @@ class IsoHuntBridge extends BridgeAbstract{ } } - public function getCacheDuration(){ - return 300; // 5 minutes - } - #region Helper functions for "Movie Torrents" private function get_movie_torrents($html){ diff --git a/bridges/JapanExpoBridge.php b/bridges/JapanExpoBridge.php index dcd951a..c44a7e9 100644 --- a/bridges/JapanExpoBridge.php +++ b/bridges/JapanExpoBridge.php @@ -4,6 +4,7 @@ class JapanExpoBridge extends BridgeAbstract { const MAINTAINER = 'Ginko'; const NAME = 'Japan Expo Actualités'; const URI = 'http://www.japan-expo-paris.com/fr/actualites'; + const CACHE_TIMEOUT = 14400; // 4h const DESCRIPTION = 'Returns most recent entries from Japan Expo actualités.'; const PARAMETERS = array( array( 'mode'=>array( @@ -85,8 +86,4 @@ class JapanExpoBridge extends BridgeAbstract { $count++; } } - - public function getCacheDuration(){ - return 14400; // 4 hours - } } diff --git a/bridges/KununuBridge.php b/bridges/KununuBridge.php index a958b77..76a8007 100644 --- a/bridges/KununuBridge.php +++ b/bridges/KununuBridge.php @@ -3,6 +3,7 @@ class KununuBridge extends BridgeAbstract { const MAINTAINER = "logmanoriginal"; const NAME = "Kununu Bridge"; const URI = "https://www.kununu.com/"; + const CACHE_TIMEOUT = 86400; // 24h const DESCRIPTION = "Returns the latest reviews for a company and site of your choice."; const PARAMETERS = array( @@ -101,10 +102,6 @@ class KununuBridge extends BridgeAbstract { } } - public function getCacheDuration(){ - return 86400; // 1 day - } - /** * Fixes relative URLs in the given text */ diff --git a/bridges/LWNprevBridge.php b/bridges/LWNprevBridge.php index 704c1d5..585eaf9 100644 --- a/bridges/LWNprevBridge.php +++ b/bridges/LWNprevBridge.php @@ -3,6 +3,7 @@ class LWNprevBridge extends BridgeAbstract{ const MAINTAINER = 'Pierre Mazière'; const NAME = 'LWN Free Weekly Edition'; const URI = 'https://lwn.net/'; + const CACHE_TIMEOUT = 604800; // 1 week const DESCRIPTION = 'LWN Free Weekly Edition available one week late'; function getURI(){ @@ -140,8 +141,4 @@ class LWNprevBridge extends BridgeAbstract{ $this->items[]=$item; } } - - public function getCacheDuration(){ - return 604800; // one week - } } diff --git a/bridges/LeMondeInformatiqueBridge.php b/bridges/LeMondeInformatiqueBridge.php index 889710f..e1154e4 100644 --- a/bridges/LeMondeInformatiqueBridge.php +++ b/bridges/LeMondeInformatiqueBridge.php @@ -4,6 +4,7 @@ class LeMondeInformatiqueBridge extends FeedExpander { const MAINTAINER = "ORelio"; const NAME = "Le Monde Informatique"; const URI = "http://www.lemondeinformatique.fr/"; + const CACHE_TIMEOUT = 1800; // 30min const DESCRIPTION = "Returns the newest articles."; public function collectData(){ @@ -38,8 +39,4 @@ class LeMondeInformatiqueBridge extends FeedExpander { $article_html = $this->StripWithDelimiters($article_html, '

'); return $article_html; } - - public function getCacheDuration() { - return 1800; // 30 minutes - } } diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php index 81023b1..ccd3fd8 100644 --- a/bridges/LesJoiesDuCodeBridge.php +++ b/bridges/LesJoiesDuCodeBridge.php @@ -4,6 +4,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{ const MAINTAINER = "superbaillot.net"; const NAME = "Les Joies Du Code"; const URI = "http://lesjoiesducode.fr/"; + const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = "LesJoiesDuCode"; public function collectData(){ @@ -43,8 +44,4 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 7200; // 2h hours - } } diff --git a/bridges/LinkedInCompanyBridge.php b/bridges/LinkedInCompanyBridge.php index 6ccbba5..6f6c176 100644 --- a/bridges/LinkedInCompanyBridge.php +++ b/bridges/LinkedInCompanyBridge.php @@ -4,6 +4,7 @@ class LinkedInCompanyBridge extends BridgeAbstract{ const MAINTAINER = "regisenguehard"; const NAME = "LinkedIn Company"; const URI = "https://www.linkedin.com/"; + const CACHE_TIMEOUT = 21600; //6 const DESCRIPTION = "Returns most recent actus from Company on LinkedIn. (https://www.linkedin.com/company/apple)"; const PARAMETERS = array( array( @@ -32,8 +33,4 @@ class LinkedInCompanyBridge extends BridgeAbstract{ } } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/MangareaderBridge.php b/bridges/MangareaderBridge.php index 60b15f0..d65c4d8 100644 --- a/bridges/MangareaderBridge.php +++ b/bridges/MangareaderBridge.php @@ -4,6 +4,7 @@ class MangareaderBridge extends BridgeAbstract { const MAINTAINER = "logmanoriginal"; const NAME = "Mangareader Bridge"; const URI = "http://www.mangareader.net/"; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = "Returns the latest updates, popular mangas or manga updates (new chapters)"; const PARAMETERS = array( @@ -148,12 +149,12 @@ class MangareaderBridge extends BridgeAbstract { if($item['content'] <> ""){ $item['content'] .= "
"; } - $item['content'] .= - "" - . htmlspecialchars($chapter->nodeValue) + $item['content'] .= + "" + . htmlspecialchars($chapter->nodeValue) . ""; } @@ -246,9 +247,5 @@ EOD; public function getName(){ return (!empty($this->request) ? $this->request . ' - ' : '') . 'Mangareader Bridge'; } - - public function getCacheDuration(){ - return 10800; // 3 hours - } } ?> diff --git a/bridges/MoebooruBridge.php b/bridges/MoebooruBridge.php index af76de4..7bb8f34 100644 --- a/bridges/MoebooruBridge.php +++ b/bridges/MoebooruBridge.php @@ -3,6 +3,7 @@ class MoebooruBridge extends BridgeAbstract{ const NAME = "Moebooru"; const URI = "https://moe.dev.myconan.net/"; + const CACHE_TIMEOUT = 1800; // 30min const DESCRIPTION = "Returns images from given page"; const PARAMETERS = array( array( @@ -42,8 +43,4 @@ class MoebooruBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 1800; // 30 minutes - } } diff --git a/bridges/MondeDiploBridge.php b/bridges/MondeDiploBridge.php index c9d20af..002b5c3 100644 --- a/bridges/MondeDiploBridge.php +++ b/bridges/MondeDiploBridge.php @@ -4,6 +4,7 @@ class MondeDiploBridge extends BridgeAbstract{ const MAINTAINER = "Pitchoule"; const NAME = 'Monde Diplomatique'; const URI = 'http://www.monde-diplomatique.fr/'; + const CACHE_TIMEOUT = 21600; //6h const DESCRIPTION = "Returns most recent results from MondeDiplo."; public function collectData(){ @@ -19,8 +20,4 @@ class MondeDiploBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/NasaApodBridge.php b/bridges/NasaApodBridge.php index 93da332..d7f0da0 100644 --- a/bridges/NasaApodBridge.php +++ b/bridges/NasaApodBridge.php @@ -4,6 +4,7 @@ class NasaApodBridge extends BridgeAbstract{ const MAINTAINER = "corenting"; const NAME = "NASA APOD Bridge"; const URI = "http://apod.nasa.gov/apod/"; + const CACHE_TIMEOUT = 43200; // 12h const DESCRIPTION = "Returns the 3 latest NASA APOD pictures and explanations"; public function collectData(){ @@ -39,8 +40,4 @@ class NasaApodBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 3600*12; // 12 hours - } } diff --git a/bridges/NovelUpdatesBridge.php b/bridges/NovelUpdatesBridge.php index 95dfc7f..3897b22 100644 --- a/bridges/NovelUpdatesBridge.php +++ b/bridges/NovelUpdatesBridge.php @@ -4,6 +4,7 @@ class NovelUpdatesBridge extends BridgeAbstract{ const MAINTAINER = "albirew"; const NAME = "Novel Updates"; const URI = "http://www.novelupdates.com/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns releases from Novel Updates"; const PARAMETERS = array( array( 'n'=>array( @@ -48,8 +49,4 @@ class NovelUpdatesBridge extends BridgeAbstract{ public function getName(){ return $this->seriesTitle. ' - ' . static::NAME; } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/OpenClassroomsBridge.php b/bridges/OpenClassroomsBridge.php index ae4ea10..ab62e28 100644 --- a/bridges/OpenClassroomsBridge.php +++ b/bridges/OpenClassroomsBridge.php @@ -4,6 +4,7 @@ class OpenClassroomsBridge extends BridgeAbstract{ const MAINTAINER = "sebsauvage"; const NAME = "OpenClassrooms Bridge"; const URI = "https://openclassrooms.com/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns latest tutorials from OpenClassrooms."; const PARAMETERS = array( array( @@ -42,8 +43,4 @@ class OpenClassroomsBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/ParuVenduImmoBridge.php b/bridges/ParuVenduImmoBridge.php index e791c7a..5717083 100644 --- a/bridges/ParuVenduImmoBridge.php +++ b/bridges/ParuVenduImmoBridge.php @@ -4,6 +4,7 @@ class ParuVenduImmoBridge extends BridgeAbstract const MAINTAINER = "polo2ro"; const NAME = "Paru Vendu Immobilier"; const URI = "http://www.paruvendu.fr"; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = "Returns the ads from the first page of search result."; @@ -92,8 +93,4 @@ class ParuVenduImmoBridge extends BridgeAbstract } return 'Paru Vendu Immobilier'.$request; } - - public function getCacheDuration(){ - return 10800; // 3 hours - } } diff --git a/bridges/PickyWallpapersBridge.php b/bridges/PickyWallpapersBridge.php index 1411373..2feb9fb 100644 --- a/bridges/PickyWallpapersBridge.php +++ b/bridges/PickyWallpapersBridge.php @@ -4,6 +4,7 @@ class PickyWallpapersBridge extends BridgeAbstract { const MAINTAINER = "nel50n"; const NAME = "PickyWallpapers Bridge"; const URI = "http://www.pickywallpapers.com/"; + const CACHE_TIMEOUT = 43200; // 12h const DESCRIPTION = "Returns the latests wallpapers from PickyWallpapers"; const PARAMETERS = array( array( @@ -69,8 +70,4 @@ class PickyWallpapersBridge extends BridgeAbstract { .($subcategory? ' > '.$subcategory : '') .' ['.$this->getInput('r').']'; } - - public function getCacheDuration(){ - return 43200; // 12 hours - } } diff --git a/bridges/PlanetLibreBridge.php b/bridges/PlanetLibreBridge.php index 1a9a118..e05b2a5 100644 --- a/bridges/PlanetLibreBridge.php +++ b/bridges/PlanetLibreBridge.php @@ -28,8 +28,4 @@ class PlanetLibreBridge extends BridgeAbstract{ } } } - - public function getCacheDuration(){ - return 3600*2; // 1 hour - } } diff --git a/bridges/RTBFBridge.php b/bridges/RTBFBridge.php index 2805884..50bf5b4 100644 --- a/bridges/RTBFBridge.php +++ b/bridges/RTBFBridge.php @@ -2,6 +2,7 @@ class RTBFBridge extends BridgeAbstract { const NAME = "RTBF Bridge"; const URI = "http://www.rtbf.be/auvio/emissions/"; + const CACHE_TIMEOUT = 21600; //6h const DESCRIPTION = "Returns the newest RTBF videos by series ID"; const MAINTAINER = "Frenzie"; @@ -46,8 +47,4 @@ class RTBFBridge extends BridgeAbstract { public function getName(){ return $this->getInput('c') .' - RTBF Bridge'; } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/Releases3DSBridge.php b/bridges/Releases3DSBridge.php index a69e9ef..7892ca9 100644 --- a/bridges/Releases3DSBridge.php +++ b/bridges/Releases3DSBridge.php @@ -4,6 +4,7 @@ class Releases3DSBridge extends BridgeAbstract { const MAINTAINER = "ORelio"; const NAME = "3DS Scene Releases"; const URI = "http://www.3dsdb.com/"; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = "Returns the newest scene releases."; public function collectData(){ @@ -116,8 +117,4 @@ class Releases3DSBridge extends BridgeAbstract { $limit++; } } - - public function getCacheDuration() { - return 10800; //3 hours - } } diff --git a/bridges/ScmbBridge.php b/bridges/ScmbBridge.php index e22b73c..d1b2a94 100644 --- a/bridges/ScmbBridge.php +++ b/bridges/ScmbBridge.php @@ -4,6 +4,7 @@ class ScmbBridge extends BridgeAbstract{ const MAINTAINER = "Astalaseven"; const NAME = "Se Coucher Moins Bête Bridge"; const URI = "http://secouchermoinsbete.fr/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns the newest anecdotes."; public function collectData(){ @@ -33,8 +34,4 @@ class ScmbBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/ScoopItBridge.php b/bridges/ScoopItBridge.php index 810edb8..e25a0a4 100644 --- a/bridges/ScoopItBridge.php +++ b/bridges/ScoopItBridge.php @@ -4,6 +4,7 @@ class ScoopItBridge extends BridgeAbstract{ const MAINTAINER = "Pitchoule"; const NAME = "ScoopIt"; const URI = "http://www.scoop.it/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns most recent results from ScoopIt."; const PARAMETERS = array( array( @@ -28,9 +29,5 @@ class ScoopItBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/SensCritiqueBridge.php b/bridges/SensCritiqueBridge.php index 32cd952..fcced92 100644 --- a/bridges/SensCritiqueBridge.php +++ b/bridges/SensCritiqueBridge.php @@ -4,6 +4,7 @@ class SensCritiqueBridge extends BridgeAbstract { const MAINTAINER = "kranack"; const NAME = "Sens Critique"; const URI = "http://www.senscritique.com/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Sens Critique news"; const PARAMETERS = array( array( @@ -74,9 +75,4 @@ class SensCritiqueBridge extends BridgeAbstract { $this->items[] = $item; } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } - } diff --git a/bridges/SexactuBridge.php b/bridges/SexactuBridge.php index 534cba5..e110b23 100644 --- a/bridges/SexactuBridge.php +++ b/bridges/SexactuBridge.php @@ -4,6 +4,7 @@ class SexactuBridge extends BridgeAbstract{ const MAINTAINER = "Riduidel"; const NAME = "Sexactu"; const URI = "https://www.gqmagazine.fr"; + const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = "Sexactu via rss-bridge"; public function collectData(){ @@ -56,10 +57,6 @@ $replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July', return self::URI.'/sexactu'; } - public function getCacheDuration(){ - return 7200; // 2h hours - } - private function correctCase($str) { $sentences=explode('.', mb_strtolower($str, "UTF-8")); $str=""; diff --git a/bridges/SoundcloudBridge.php b/bridges/SoundcloudBridge.php index ec04064..5aeed2a 100644 --- a/bridges/SoundcloudBridge.php +++ b/bridges/SoundcloudBridge.php @@ -4,6 +4,7 @@ class SoundCloudBridge extends BridgeAbstract{ const MAINTAINER = "kranack"; const NAME = "Soundcloud Bridge"; const URI = "https://soundcloud.com/"; + const CACHE_TIMEOUT = 600; // 10min const DESCRIPTION = "Returns 10 newest music from user profile"; const PARAMETERS = array( array( @@ -46,8 +47,4 @@ class SoundCloudBridge extends BridgeAbstract{ public function getName(){ return self::NAME .' - '. $this->getInput('u'); } - - public function getCacheDuration(){ - return 600; // 10 minutes - } } diff --git a/bridges/StripeAPIChangeLogBridge.php b/bridges/StripeAPIChangeLogBridge.php index da5934d..b2bda89 100644 --- a/bridges/StripeAPIChangeLogBridge.php +++ b/bridges/StripeAPIChangeLogBridge.php @@ -3,6 +3,7 @@ class StripeAPIChangeLogBridge extends BridgeAbstract{ const MAINTAINER = 'Pierre Mazière'; const NAME = 'Stripe API Changelog'; const URI = 'https://stripe.com/docs/upgrades'; + const CACHE_TIMEOUT = 86400; // 24h const DESCRIPTION = 'Returns the changes made to the stripe.com API'; public function collectData(){ @@ -20,8 +21,4 @@ class StripeAPIChangeLogBridge extends BridgeAbstract{ $this->items[]=$item; } } - - public function getCacheDuration(){ - return 86400; // one day - } } diff --git a/bridges/SuperbWallpapersBridge.php b/bridges/SuperbWallpapersBridge.php index 8bfc709..fd946c8 100644 --- a/bridges/SuperbWallpapersBridge.php +++ b/bridges/SuperbWallpapersBridge.php @@ -4,6 +4,7 @@ class SuperbWallpapersBridge extends BridgeAbstract { const MAINTAINER = "nel50n"; const NAME = "Superb Wallpapers Bridge"; const URI = "http://www.superbwallpapers.com/"; + const CACHE_TIMEOUT = 43200; // 12h const DESCRIPTION = "Returns the latests wallpapers from SuperbWallpapers"; const PARAMETERS = array( array( @@ -62,8 +63,4 @@ class SuperbWallpapersBridge extends BridgeAbstract { public function getName(){ return self::NAME .'- '.$this->getInput('c').' ['.$this->getInput('r').']'; } - - public function getCacheDuration(){ - return 43200; // 12 hours - } } diff --git a/bridges/TagBoardBridge.php b/bridges/TagBoardBridge.php index cda4925..6f947fc 100644 --- a/bridges/TagBoardBridge.php +++ b/bridges/TagBoardBridge.php @@ -4,6 +4,7 @@ class TagBoardBridge extends BridgeAbstract{ const MAINTAINER = "Pitchoule"; const NAME = "TagBoard"; const URI = "http://www.TagBoard.com/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns most recent results from TagBoard."; const PARAMETERS = array( array( @@ -37,9 +38,5 @@ class TagBoardBridge extends BridgeAbstract{ public function getName(){ return 'tagboard - ' .$this->getInput('u'); } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/TheCodingLoveBridge.php b/bridges/TheCodingLoveBridge.php index 2120442..6e09f6a 100644 --- a/bridges/TheCodingLoveBridge.php +++ b/bridges/TheCodingLoveBridge.php @@ -4,6 +4,7 @@ class TheCodingLoveBridge extends BridgeAbstract{ const MAINTAINER = "superbaillot.net"; const NAME = "The Coding Love"; const URI = "http://thecodinglove.com/"; + const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = "The Coding Love"; public function collectData(){ @@ -44,8 +45,4 @@ class TheCodingLoveBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getCacheDuration(){ - return 7200; // 2h hours - } } diff --git a/bridges/TheOatMealBridge.php b/bridges/TheOatMealBridge.php index 24e9763..8be5a30 100644 --- a/bridges/TheOatMealBridge.php +++ b/bridges/TheOatMealBridge.php @@ -4,6 +4,7 @@ class TheOatmealBridge extends FeedExpander{ const MAINTAINER = "Riduidel"; const NAME = "The Oatmeal"; const URI = "http://theoatmeal.com/"; + const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = "Un petit site de dessins assez rigolos"; public function collectData(){ @@ -23,8 +24,4 @@ class TheOatmealBridge extends FeedExpander{ return $item; } - - public function getCacheDuration(){ - return 7200; // 2h hours - } } diff --git a/bridges/TwitchApiBridge.php b/bridges/TwitchApiBridge.php index 11da945..a36dab8 100644 --- a/bridges/TwitchApiBridge.php +++ b/bridges/TwitchApiBridge.php @@ -6,6 +6,7 @@ class TwitchApiBridge extends BridgeAbstract{ const MAINTAINER = "logmanoriginal"; const NAME = "Twitch API Bridge"; const URI = "http://www.twitch.tv"; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = "Returns the newest broadcasts or highlights by channel name using the Twitch API (v3)"; const PARAMETERS = array( @@ -105,9 +106,5 @@ class TwitchApiBridge extends BridgeAbstract{ public function getName(){ return $this->getInput('channel') . ' - Twitch API Bridge'; } - - public function getCacheDuration(){ - return 10800; // 3 hours - } } ?> diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index e30f7f0..f4f2a19 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -2,6 +2,7 @@ class TwitterBridge extends BridgeAbstract{ const NAME='Twitter Bridge'; const URI='https://twitter.com/'; + const CACHE_TIMEOUT = 300; // 5min const DESCRIPTION='returns tweets'; const PARAMETERS=array( 'global'=>array( @@ -135,8 +136,4 @@ EOD; $this->items[] = $item; } } - - public function getCacheDuration(){ - return 300; // 5 minutes - } } diff --git a/bridges/UnsplashBridge.php b/bridges/UnsplashBridge.php index 85ce0c2..6d776da 100644 --- a/bridges/UnsplashBridge.php +++ b/bridges/UnsplashBridge.php @@ -4,6 +4,7 @@ class UnsplashBridge extends BridgeAbstract { const MAINTAINER = "nel50n"; const NAME = "Unsplash Bridge"; const URI = "http://unsplash.com/"; + const CACHE_TIMEOUT = 43200; // 12h const DESCRIPTION = "Returns the latests photos from Unsplash"; const PARAMETERS = array( array( @@ -60,8 +61,4 @@ class UnsplashBridge extends BridgeAbstract { } } } - - public function getCacheDuration(){ - return 43200; // 12 hours - } } diff --git a/bridges/ViadeoCompanyBridge.php b/bridges/ViadeoCompanyBridge.php index 75fd6aa..275ff76 100644 --- a/bridges/ViadeoCompanyBridge.php +++ b/bridges/ViadeoCompanyBridge.php @@ -4,6 +4,7 @@ class ViadeoCompanyBridge extends BridgeAbstract{ const MAINTAINER = "regisenguehard"; const NAME = "Viadeo Company"; const URI = "https://www.viadeo.com/"; + const CACHE_TIMEOUT = 21600; // 6h const DESCRIPTION = "Returns most recent actus from Company on Viadeo. (http://www.viadeo.com/fr/company/apple)"; const PARAMETERS = array( array( @@ -32,8 +33,4 @@ class ViadeoCompanyBridge extends BridgeAbstract{ } } } - - public function getCacheDuration(){ - return 21600; // 6 hours - } } diff --git a/bridges/VineBridge.php b/bridges/VineBridge.php index 6c42dd1..5969ce7 100644 --- a/bridges/VineBridge.php +++ b/bridges/VineBridge.php @@ -38,8 +38,4 @@ class VineBridge extends BridgeAbstract { } } - - public function getCacheDuration(){ - return 10; //seconds - } } diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php index 5489599..98ae78f 100644 --- a/bridges/VkBridge.php +++ b/bridges/VkBridge.php @@ -5,6 +5,7 @@ class VkBridge extends BridgeAbstract { const MAINTAINER = "ahiles3005"; const NAME = "VK.com"; const URI = "http://vk.com/"; + const CACHE_TIMEOUT = 300; // 5min const DESCRIPTION = "Working with open pages"; const PARAMETERS=array( array( 'u'=>array( @@ -45,9 +46,4 @@ class VkBridge extends BridgeAbstract { // var_dump($item['date']); } } - - public function getCacheDuration() { - return 300; // 5 minutes - } - } diff --git a/bridges/WallpaperStopBridge.php b/bridges/WallpaperStopBridge.php index b10d0cc..35333dc 100644 --- a/bridges/WallpaperStopBridge.php +++ b/bridges/WallpaperStopBridge.php @@ -4,6 +4,7 @@ class WallpaperStopBridge extends BridgeAbstract { const MAINTAINER = "nel50n"; const NAME = "WallpaperStop Bridge"; const URI = "http://www.wallpaperstop.com"; + const CACHE_TIMEOUT = 43200; // 12h const DESCRIPTION = "Returns the latests wallpapers from WallpaperStop"; const PARAMETERS = array( array( @@ -66,8 +67,4 @@ class WallpaperStopBridge extends BridgeAbstract { $subcategory=$this->getInput('s'); return 'WallpaperStop - '.$this->getInput('c').(!empty($subcategory) ? ' > '.$subcategory : '').' ['.$this->getInput('r').']'; } - - public function getCacheDuration(){ - return 43200; // 12 hours - } } diff --git a/bridges/WhydBridge.php b/bridges/WhydBridge.php index ec377eb..feabdec 100644 --- a/bridges/WhydBridge.php +++ b/bridges/WhydBridge.php @@ -4,6 +4,7 @@ class WhydBridge extends BridgeAbstract{ const MAINTAINER = "kranack"; const NAME = "Whyd Bridge"; const URI = "http://www.whyd.com/"; + const CACHE_TIMEOUT = 600; // 10min const DESCRIPTION = "Returns 10 newest music from user profile"; const PARAMETERS = array( array( @@ -52,10 +53,6 @@ class WhydBridge extends BridgeAbstract{ public function getName(){ return (!empty($this->userName) ? $this->userName .' - ' : '') .'Whyd Bridge'; } - - public function getCacheDuration(){ - return 600; // 10 minutes - } } diff --git a/bridges/WordPressBridge.php b/bridges/WordPressBridge.php index d686a98..ccdb780 100644 --- a/bridges/WordPressBridge.php +++ b/bridges/WordPressBridge.php @@ -3,6 +3,7 @@ class WordPressBridge extends FeedExpander { const MAINTAINER = "aledeg"; const NAME = "Wordpress Bridge"; const URI = "https://wordpress.org/"; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = "Returns the newest full posts of a Wordpress powered website"; const PARAMETERS = array( array( @@ -69,8 +70,4 @@ class WordPressBridge extends FeedExpander { $this->collectExpandableDatas($this->getURI().'/feed/atom/'); } - - public function getCacheDuration() { - return 3600*3; // 3 hours - } } diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index 6c258f4..aa7f834 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -10,6 +10,7 @@ class YoutubeBridge extends BridgeAbstract { const NAME = 'YouTube Bridge'; const URI = 'https://www.youtube.com/'; + const CACHE_TIMEOUT = 10800; // 3h const DESCRIPTION = 'Returns the 10 newest videos by username/channel/playlist or search'; const MAINTAINER = 'mitsukarenai'; @@ -149,8 +150,4 @@ class YoutubeBridge extends BridgeAbstract { public function getName(){ return (!empty($this->request) ? $this->request .' - ' : '') .'YouTube Bridge'; } - - public function getCacheDuration(){ - return 10800; // 3 hours - } } diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index f746f1f..854403d 100644 --- a/lib/BridgeAbstract.php +++ b/lib/BridgeAbstract.php @@ -6,6 +6,7 @@ abstract class BridgeAbstract implements BridgeInterface { const URI = ''; const DESCRIPTION = 'No description provided'; const MAINTAINER = 'No maintainer'; + const CACHE_TIMEOUT = 3600; const PARAMETERS = array(); public $useProxy = true; @@ -252,7 +253,7 @@ abstract class BridgeAbstract implements BridgeInterface { if(!is_null($this->cache)){ $this->cache->prepare($inputs); $time = $this->cache->getTime(); - if($time !== false && (time() - $this->getCacheDuration() < $time)){ + if($time !== false && (time() - static::CACHE_TIMEOUT < $time)){ $this->items = $this->cache->loadData(); return; } @@ -306,10 +307,6 @@ abstract class BridgeAbstract implements BridgeInterface { return static::URI; } - public function getCacheDuration(){ - return 3600; - } - public function setCache(\CacheAbstract $cache){ $this->cache = $cache; } diff --git a/lib/BridgeInterface.php b/lib/BridgeInterface.php index a63b63f..a7932a8 100644 --- a/lib/BridgeInterface.php +++ b/lib/BridgeInterface.php @@ -1,7 +1,6 @@