From 63bb7ef24ded812d6c4b959ddbe0cafe04c83b39 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Tue, 9 Aug 2016 20:01:21 +0200 Subject: [PATCH 01/12] bridges: Remove unnecessary functions getName() and getURI() --- bridges/ABCTabsBridge.php | 12 ------------ bridges/AcrimedBridge.php | 14 +------------- bridges/AnimeUltimeBridge.php | 4 ---- bridges/ArstechnicaBridge.php | 9 --------- bridges/Arte7Bridge.php | 8 -------- bridges/BandcampBridge.php | 4 ---- bridges/BastaBridge.php | 10 +--------- bridges/BlaguesDeMerdeBridge.php | 8 -------- bridges/BooruprojectBridge.php | 8 -------- bridges/CADBridge.php | 10 +--------- bridges/CastorusBridge.php | 18 +++++------------- bridges/CollegeDeFranceBridge.php | 10 +--------- bridges/CommonDreamsBridge.php | 10 +--------- bridges/CopieDoubleBridge.php | 10 +--------- bridges/CourrierInternationalBridge.php | 12 ++---------- bridges/CryptomeBridge.php | 10 +--------- bridges/DailymotionBridge.php | 4 ---- bridges/DanbooruBridge.php | 8 -------- bridges/DansTonChatBridge.php | 12 ++---------- bridges/DauphineLibereBridge.php | 12 ++---------- bridges/DemoBridge.php | 12 ------------ bridges/DeveloppezDotComBridge.php | 10 +--------- bridges/DollbooruBridge.php | 8 -------- bridges/DuckDuckGoBridge.php | 10 +--------- bridges/EZTVBridge.php | 10 +--------- bridges/EliteDangerousGalnetBridge.php | 12 +----------- bridges/ElsevierBridge.php | 8 -------- bridges/FierPandaBridge.php | 10 +--------- bridges/FlickrExploreBridge.php | 8 -------- bridges/FlickrTagBridge.php | 8 -------- bridges/FootitoBridge.php | 8 -------- bridges/FourchanBridge.php | 10 +--------- bridges/GBAtempBridge.php | 24 ++++++++++-------------- bridges/GelbooruBridge.php | 8 -------- bridges/GiphyBridge.php | 10 +--------- bridges/GithubIssueBridge.php | 8 -------- bridges/GitlabCommitsBridge.php | 8 -------- bridges/GizmodoFRBridge.php | 10 +--------- bridges/GoogleSearchBridge.php | 6 +----- bridges/GuruMedBridge.php | 10 +--------- bridges/HDWallpapersBridge.php | 4 ---- bridges/HentaiHavenBridge.php | 9 ++------- bridges/InstagramBridge.php | 6 +----- bridges/JapanExpoBridge.php | 10 +--------- bridges/KonachanBridge.php | 8 -------- bridges/KoreusBridge.php | 10 +--------- bridges/LWNprevBridge.php | 8 -------- bridges/LeBonCoinBridge.php | 10 +--------- bridges/LeJournalDuGeekBridge.php | 10 +--------- bridges/LeMondeInformatiqueBridge.php | 8 -------- bridges/LesJoiesDuCodeBridge.php | 8 -------- bridges/LinkedInCompany.php | 8 -------- bridges/LolibooruBridge.php | 8 -------- bridges/MangareaderBridge.php | 4 ---- bridges/MilbooruBridge.php | 8 -------- bridges/MondeDiploBridge.php | 18 +++++------------- bridges/MsnMondeBridge.php | 16 ++++------------ bridges/MspabooruBridge.php | 8 -------- bridges/NasaApodBridge.php | 10 +--------- bridges/NeuviemeArtBridge.php | 12 ++---------- bridges/NextInpactBridge.php | 8 -------- bridges/NiceMatinBridge.php | 10 +--------- bridges/NovelUpdatesBridge.php | 7 +++---- bridges/NumeramaBridge.php | 12 ++---------- bridges/OpenClassroomsBridge.php | 10 +--------- bridges/ParuVenduImmoBridge.php | 12 ++++-------- bridges/PickyWallpapersBridge.php | 4 ---- bridges/PlanetLibreBridge.php | 8 +------- bridges/ProjectMGameBridge.php | 10 +--------- bridges/RTBFBridge.php | 4 ---- bridges/Releases3DSBridge.php | 8 -------- bridges/ReporterreBridge.php | 12 ++---------- bridges/Rue89Bridge.php | 8 +------- bridges/Rule34Bridge.php | 8 -------- bridges/Rule34pahealBridge.php | 8 -------- bridges/SafebooruBridge.php | 8 -------- bridges/SakugabooruBridge.php | 8 -------- bridges/ScmbBridge.php | 10 +--------- bridges/ScoopItBridge.php | 10 +--------- bridges/SensCritiqueBridge.php | 4 ---- bridges/Sexactu.php | 11 +++-------- bridges/SiliconBridge.php | 13 ++----------- bridges/StripeAPIChangeLogBridge.php | 10 +--------- bridges/SuperbWallpapersBridge.php | 4 ---- bridges/T411Bridge.php | 16 ++++------------ bridges/TagBoardBridge.php | 4 ---- bridges/TbibBridge.php | 8 -------- bridges/TheCodingLoveBridge.php | 8 -------- bridges/ThePirateBayBridge.php | 10 +--------- bridges/TwitchApiBridge.php | 4 ---- bridges/TwitterBridge.php | 6 +----- bridges/TwitterBridgeClean.php | 6 +----- bridges/TwitterBridgeCleanExtended.php | 6 +----- bridges/TwitterBridgeExtended.php | 10 +--------- bridges/TwitterBridgeTweaked.php | 10 +--------- bridges/UnsplashBridge.php | 8 -------- bridges/ViadeoCompany.php | 8 -------- bridges/VineBridge.php | 10 +--------- bridges/WallpaperStopBridge.php | 4 ---- bridges/WordPressBridge.php | 6 +----- bridges/XbooruBridge.php | 8 -------- bridges/YandereBridge.php | 8 -------- bridges/YoutubeBridge.php | 24 ++++++++++-------------- bridges/ZatazBridge.php | 16 ++++------------ 104 files changed, 107 insertions(+), 854 deletions(-) diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php index 29b41e0..8e2becc 100644 --- a/bridges/ABCTabsBridge.php +++ b/bridges/ABCTabsBridge.php @@ -29,16 +29,4 @@ class ABCTabsBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getName() { - - return "ABC Tabs Bridge"; - - } - - public function getURI() { - - return "http://www.abc-tabs.com/"; - - } } diff --git a/bridges/AcrimedBridge.php b/bridges/AcrimedBridge.php index 4ef08bd..85e93fe 100644 --- a/bridges/AcrimedBridge.php +++ b/bridges/AcrimedBridge.php @@ -7,7 +7,7 @@ class AcrimedBridge extends RssExpander{ $this->name = "Acrimed Bridge"; $this->uri = "http://www.acrimed.org/"; $this->description = "Returns the newest articles."; - $this->update = "2014-05-25"; + $this->update = "2016-08-09"; } @@ -40,18 +40,6 @@ class AcrimedBridge extends RssExpander{ } - public function getName() { - - return "Acrimed Bridge"; - - } - - public function getURI() { - - return "http://www.acrimed.org/"; - - } - public function getCacheDuration(){ return 4800; // 2 hours } diff --git a/bridges/AnimeUltimeBridge.php b/bridges/AnimeUltimeBridge.php index 224f664..274b64c 100644 --- a/bridges/AnimeUltimeBridge.php +++ b/bridges/AnimeUltimeBridge.php @@ -125,10 +125,6 @@ class AnimeUltimeBridge extends BridgeAbstract { return 'Latest '.$this->filter.' - Anime-Ultime Bridge'; } - public function getURI() { - return 'http://www.anime-ultime.net/'; - } - public function getCacheDuration() { return 3600*3; // 3 hours } diff --git a/bridges/ArstechnicaBridge.php b/bridges/ArstechnicaBridge.php index 3e0b3c4..a4a08ce 100644 --- a/bridges/ArstechnicaBridge.php +++ b/bridges/ArstechnicaBridge.php @@ -62,17 +62,8 @@ class ArstechnicaBridge extends BridgeAbstract { } - - public function getName() { - return 'ArsTechnica'; - } - public function getCacheDuration() { return 7200; // 2h } - public function getURI() { - return "http://arstechnica.com"; - } - } diff --git a/bridges/Arte7Bridge.php b/bridges/Arte7Bridge.php index 2c2e2f6..25b7d45 100644 --- a/bridges/Arte7Bridge.php +++ b/bridges/Arte7Bridge.php @@ -156,14 +156,6 @@ class Arte7Bridge extends BridgeAbstract{ } } - public function getName(){ - return 'Arte7'; - } - - public function getURI(){ - return 'http://www.arte.tv/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/BandcampBridge.php b/bridges/BandcampBridge.php index 80e3dee..e396e7e 100644 --- a/bridges/BandcampBridge.php +++ b/bridges/BandcampBridge.php @@ -51,10 +51,6 @@ class BandcampBridge extends BridgeAbstract{ return (!empty($this->request) ? $this->request .' - ' : '') .'Bandcamp Tag'; } - public function getURI(){ - return 'http://bandcamp.com'; - } - public function getCacheDuration(){ return 600; // 10 minutes } diff --git a/bridges/BastaBridge.php b/bridges/BastaBridge.php index acdcd67..5c23ed3 100644 --- a/bridges/BastaBridge.php +++ b/bridges/BastaBridge.php @@ -5,7 +5,7 @@ class BastaBridge extends BridgeAbstract{ $this->name = "Bastamag Bridge"; $this->uri = "http://www.bastamag.net/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-02"; + $this->update = "2016-08-09"; } public function collectData(array $param){ @@ -30,14 +30,6 @@ class BastaBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Bastamag Bridge'; - } - - public function getURI(){ - return 'http://bastamag.net/'; - } - public function getCacheDuration(){ return 3600*2; // 2 hours } diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php index d977cae..b6c6405 100644 --- a/bridges/BlaguesDeMerdeBridge.php +++ b/bridges/BlaguesDeMerdeBridge.php @@ -32,14 +32,6 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{ } } - public function getName(){ - return 'blaguesdemerde'; - } - - public function getURI(){ - return 'http://www.blaguesdemerde.fr/'; - } - public function getCacheDuration(){ return 7200; // 2h hours } diff --git a/bridges/BooruprojectBridge.php b/bridges/BooruprojectBridge.php index 3ed40f2..34c79d6 100644 --- a/bridges/BooruprojectBridge.php +++ b/bridges/BooruprojectBridge.php @@ -58,14 +58,6 @@ class BooruprojectBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Booruproject'; - } - - public function getURI(){ - return 'http://booru.org/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/CADBridge.php b/bridges/CADBridge.php index 299bd10..0b57ee5 100644 --- a/bridges/CADBridge.php +++ b/bridges/CADBridge.php @@ -5,7 +5,7 @@ class CADBridge extends BridgeAbstract{ $this->name = "CAD Bridge"; $this->uri = "http://www.cad-comic.com/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function CADExtractContent($url) { @@ -63,14 +63,6 @@ class CADBridge extends BridgeAbstract{ } } - public function getName(){ - return 'CAD Bridge'; - } - - public function getURI(){ - return 'http://www.cad-comic.com/'; - } - public function getCacheDuration(){ return 3600*2; // 2 hours } diff --git a/bridges/CastorusBridge.php b/bridges/CastorusBridge.php index a6ac5f4..6be6588 100644 --- a/bridges/CastorusBridge.php +++ b/bridges/CastorusBridge.php @@ -3,9 +3,9 @@ class CastorusBridge extends BridgeAbstract { public function loadMetadatas(){ $this->maintainer = "logmanoriginal"; $this->name = "Castorus Bridge"; - $this->uri = $this->getURI(); + $this->uri = 'http://www.castorus.com'; $this->description = "Returns the latest changes"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters["Get latest changes"] = '[]'; $this->parameters["Get latest changes via ZIP code"] = @@ -49,7 +49,7 @@ class CastorusBridge extends BridgeAbstract { if(!$url) $this->returnError('Cannot find url!', 404); - return $this->getURI() . $url->href; + return $this->uri . $url->href; } // Extracts the time from an activity @@ -85,10 +85,10 @@ class CastorusBridge extends BridgeAbstract { if(isset($params['city'])) $city_filter = trim($params['city']); - $html = $this->file_get_html($this->getURI()); + $html = $this->file_get_html($this->uri); if(!$html) - $this->returnError('Could not load data from ' . $this->getURI() . '!', 404); + $this->returnError('Could not load data from ' . $this->uri . '!', 404); $activities = $html->find('div#activite/li'); @@ -116,14 +116,6 @@ class CastorusBridge extends BridgeAbstract { } } - public function getName(){ - return 'Castorus Bridge'; - } - - public function getURI(){ - return 'http://www.castorus.com'; - } - public function getCacheDuration(){ return 600; // 10 minutes } diff --git a/bridges/CollegeDeFranceBridge.php b/bridges/CollegeDeFranceBridge.php index 585ceba..5dbd195 100644 --- a/bridges/CollegeDeFranceBridge.php +++ b/bridges/CollegeDeFranceBridge.php @@ -6,7 +6,7 @@ class CollegeDeFranceBridge extends BridgeAbstract{ $this->name = "CollegeDeFrance"; $this->uri = "http://www.college-de-france.fr/"; $this->description = "Returns the latest audio and video from CollegeDeFrance"; - $this->update = "2016-05-01"; + $this->update = "2016-08-09"; } public function collectData(array $param) { @@ -54,14 +54,6 @@ class CollegeDeFranceBridge extends BridgeAbstract{ } } - public function getName(){ - return 'CollegeDeFrance'; - } - - public function getURI(){ - return 'http://www.college-de-france.fr/'; - } - public function getCacheDuration(){ return 3600*3; // 3 hours } diff --git a/bridges/CommonDreamsBridge.php b/bridges/CommonDreamsBridge.php index 54cf526..08a055c 100644 --- a/bridges/CommonDreamsBridge.php +++ b/bridges/CommonDreamsBridge.php @@ -6,7 +6,7 @@ class CommonDreamsBridge extends BridgeAbstract{ $this->name = "CommonDreams Bridge"; $this->uri = "http://www.commondreams.org/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function CommonDreamsExtractContent($url) { @@ -39,12 +39,4 @@ class CommonDreamsBridge extends BridgeAbstract{ } } } - - public function getName(){ - return 'CommonDreams Bridge'; - } - - public function getURI(){ - return 'http://www.commondreams.org/'; - } } diff --git a/bridges/CopieDoubleBridge.php b/bridges/CopieDoubleBridge.php index d629976..62935f6 100644 --- a/bridges/CopieDoubleBridge.php +++ b/bridges/CopieDoubleBridge.php @@ -7,7 +7,7 @@ class CopieDoubleBridge extends BridgeAbstract{ $this->name = "CopieDouble"; $this->uri = "http://www.copie-double.com/"; $this->description = "CopieDouble"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } @@ -42,14 +42,6 @@ class CopieDoubleBridge extends BridgeAbstract{ } } - public function getName(){ - return 'CopieDouble'; - } - - public function getURI(){ - return 'http://www.copie-double.com'; - } - public function getCacheDuration(){ return 14400; // 4 hours } diff --git a/bridges/CourrierInternationalBridge.php b/bridges/CourrierInternationalBridge.php index e35eb47..1e8f8cd 100644 --- a/bridges/CourrierInternationalBridge.php +++ b/bridges/CourrierInternationalBridge.php @@ -4,10 +4,10 @@ class CourrierInternationalBridge extends BridgeAbstract{ public function loadMetadatas() { $this->maintainer = "teromene"; - $this->name = "CourrierInternational"; + $this->name = "Courrier International Bridge"; $this->uri = "http://CourrierInternational.fr/"; $this->description = "Courrier International bridge"; - $this->update = "01/09/2015"; + $this->update = "2016-08-09"; } @@ -61,14 +61,6 @@ class CourrierInternationalBridge extends BridgeAbstract{ } - public function getName(){ - return 'Courrier International Bridge'; - } - - public function getURI(){ - return 'http://courrierinternational.com'; - } - public function getCacheDuration(){ return 300; // 5 minutes } diff --git a/bridges/CryptomeBridge.php b/bridges/CryptomeBridge.php index 9f80671..74da107 100644 --- a/bridges/CryptomeBridge.php +++ b/bridges/CryptomeBridge.php @@ -7,7 +7,7 @@ class CryptomeBridge extends BridgeAbstract{ $this->name = "Cryptome"; $this->uri = "http://cryptome.org/"; $this->description = "Returns the N most recent documents."; - $this->update = ""; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -46,14 +46,6 @@ class CryptomeBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Cryptome'; - } - - public function getURI(){ - return 'https://secure.netsolhost.com/cryptome.org/'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/DailymotionBridge.php b/bridges/DailymotionBridge.php index b9d4227..85afc3b 100644 --- a/bridges/DailymotionBridge.php +++ b/bridges/DailymotionBridge.php @@ -96,10 +96,6 @@ class DailymotionBridge extends BridgeAbstract{ return (!empty($this->request) ? $this->request .' - ' : '') .'Dailymotion Bridge'; } - public function getURI(){ - return 'https://www.dailymotion.com/'; - } - public function getCacheDuration(){ return 3600*3; // 3 hours } diff --git a/bridges/DanbooruBridge.php b/bridges/DanbooruBridge.php index 91befb1..7f4560f 100644 --- a/bridges/DanbooruBridge.php +++ b/bridges/DanbooruBridge.php @@ -45,14 +45,6 @@ class DanbooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Danbooru'; - } - - public function getURI(){ - return 'http://donmai.us/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php index 947ed61..5f5d72e 100644 --- a/bridges/DansTonChatBridge.php +++ b/bridges/DansTonChatBridge.php @@ -5,9 +5,9 @@ class DansTonChatBridge extends BridgeAbstract{ $this->maintainer = "Astalaseven"; $this->name = "DansTonChat Bridge"; - $this->uri = "http://danstonchat.com/latest.html"; + $this->uri = "http://danstonchat.com"; $this->description = "Returns latest quotes from DansTonChat."; - $this->update = "2014-05-25"; + $this->update = "2016-08-09"; } @@ -26,14 +26,6 @@ class DansTonChatBridge extends BridgeAbstract{ } } - public function getName(){ - return 'DansTonChat'; - } - - public function getURI(){ - return 'http://danstonchat.com'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/DauphineLibereBridge.php b/bridges/DauphineLibereBridge.php index 24477a7..7ef4161 100644 --- a/bridges/DauphineLibereBridge.php +++ b/bridges/DauphineLibereBridge.php @@ -4,10 +4,10 @@ class DauphineLibereBridge extends BridgeAbstract { public function loadMetadatas() { $this->maintainer = "qwertygc"; - $this->name = "DauphineLibereBridge Bridge"; + $this->name = "Dauphine Bridge"; $this->uri = "http://www.ledauphine.com/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -122,14 +122,6 @@ class DauphineLibereBridge extends BridgeAbstract { } } - public function getName(){ - return 'Dauphine Bridge'; - } - - public function getURI(){ - return 'http://ledauphine.com/'; - } - public function getCacheDuration(){ return 3600*2; // 2 hours } diff --git a/bridges/DemoBridge.php b/bridges/DemoBridge.php index 2e576c6..b772ad1 100644 --- a/bridges/DemoBridge.php +++ b/bridges/DemoBridge.php @@ -64,18 +64,6 @@ class DemoBridge extends BridgeAbstract{ } - public function getName() { - - return "DemoBridge"; - - } - - public function getURI() { - - return "http://github.com/sebsauvage/rss-bridge"; - - } - public function getCacheDuration(){ return 00; // 1 hour } diff --git a/bridges/DeveloppezDotComBridge.php b/bridges/DeveloppezDotComBridge.php index 66a9b2b..e44160f 100644 --- a/bridges/DeveloppezDotComBridge.php +++ b/bridges/DeveloppezDotComBridge.php @@ -6,7 +6,7 @@ class DeveloppezDotComBridge extends BridgeAbstract{ $this->name = "Developpez.com Actus (FR)"; $this->uri = "http://www.developpez.com/"; $this->description = "Returns the 15 newest posts from DeveloppezDotCom (full text)."; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function DeveloppezDotComStripCDATA($string) { @@ -59,14 +59,6 @@ class DeveloppezDotComBridge extends BridgeAbstract{ } } - public function getName(){ - return 'DeveloppezDotCom'; - } - - public function getURI(){ - return 'http://www.developpez.com/'; - } - public function getCacheDuration(){ return 1800; // 30min } diff --git a/bridges/DollbooruBridge.php b/bridges/DollbooruBridge.php index fe6d6fb..3f81071 100644 --- a/bridges/DollbooruBridge.php +++ b/bridges/DollbooruBridge.php @@ -48,14 +48,6 @@ class DollbooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Dollbooru'; - } - - public function getURI(){ - return 'http://dollbooru.org/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/DuckDuckGoBridge.php b/bridges/DuckDuckGoBridge.php index eca6327..999b8e3 100644 --- a/bridges/DuckDuckGoBridge.php +++ b/bridges/DuckDuckGoBridge.php @@ -7,7 +7,7 @@ class DuckDuckGoBridge extends BridgeAbstract{ $this->name = "DuckDuckGo"; $this->uri = "https://duckduckgo.com/"; $this->description = "Returns most recent results from DuckDuckGo."; - $this->update = "2014-05-25"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -33,14 +33,6 @@ class DuckDuckGoBridge extends BridgeAbstract{ } } - public function getName(){ - return 'DuckDuckGo'; - } - - public function getURI(){ - return 'https://duckduckgo.com'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/EZTVBridge.php b/bridges/EZTVBridge.php index c171aee..16c106c 100644 --- a/bridges/EZTVBridge.php +++ b/bridges/EZTVBridge.php @@ -7,7 +7,7 @@ class EZTVBridge extends BridgeAbstract{ $this->name = "EZTV"; $this->uri = "https://eztv.ch/"; $this->description = "Returns list of *recent* torrents for a specific show on EZTV. Get showID from URLs in https://eztv.ch/shows/showID/show-full-name."; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -72,12 +72,4 @@ class EZTVBridge extends BridgeAbstract{ } } } - - public function getName(){ - return 'EZTV'; - } - - public function getURI(){ - return 'https://eztv.ch/'; - } } diff --git a/bridges/EliteDangerousGalnetBridge.php b/bridges/EliteDangerousGalnetBridge.php index f9ff981..38490b5 100644 --- a/bridges/EliteDangerousGalnetBridge.php +++ b/bridges/EliteDangerousGalnetBridge.php @@ -8,7 +8,7 @@ class EliteDangerousGalnetBridge extends BridgeAbstract $this->name = "Elite: Dangerous Galnet"; $this->uri = "https://community.elitedangerous.com/galnet"; $this->description = "Returns the latest page of news from Galnet"; - $this->update = "2016-04-06"; + $this->update = "2016-08-09"; } public function collectData(array $param) @@ -36,16 +36,6 @@ class EliteDangerousGalnetBridge extends BridgeAbstract } } - public function getName() - { - return 'Elite: Dangerous Galnet'; - } - - public function getURI() - { - return 'https://community.elitedangerous.com/galnet'; - } - public function getCacheDuration() { return 3600 * 2; // 2 hours diff --git a/bridges/ElsevierBridge.php b/bridges/ElsevierBridge.php index cca3d85..6c44cac 100644 --- a/bridges/ElsevierBridge.php +++ b/bridges/ElsevierBridge.php @@ -76,14 +76,6 @@ class ElsevierBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Elsevier journals recent articles'; - } - - public function getURI(){ - return 'http://www.journals.elsevier.com'; - } - public function getCacheDuration(){ return 43200; // 12h } diff --git a/bridges/FierPandaBridge.php b/bridges/FierPandaBridge.php index cba96d3..c747a5a 100644 --- a/bridges/FierPandaBridge.php +++ b/bridges/FierPandaBridge.php @@ -7,7 +7,7 @@ Class FierPandaBridge extends BridgeAbstract{ $this->name = "Fier Panda Bridge"; $this->uri = "http://www.fier-panda.fr/"; $this->description = "Returns latest articles from Fier Panda."; - $this->update = "2015-12-11"; + $this->update = "2016-08-09"; } @@ -27,14 +27,6 @@ Class FierPandaBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Fier Panda'; - } - - public function getURI(){ - return 'http://www.fier-panda.fr'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/FlickrExploreBridge.php b/bridges/FlickrExploreBridge.php index 8e859b1..9629302 100644 --- a/bridges/FlickrExploreBridge.php +++ b/bridges/FlickrExploreBridge.php @@ -36,14 +36,6 @@ class FlickrExploreBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Flickr Explore'; - } - - public function getURI(){ - return 'https://www.flickr.com/explore'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/FlickrTagBridge.php b/bridges/FlickrTagBridge.php index 61f59a2..700f5fe 100644 --- a/bridges/FlickrTagBridge.php +++ b/bridges/FlickrTagBridge.php @@ -51,14 +51,6 @@ class FlickrTagBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Flickr Tag'; - } - - public function getURI(){ - return 'http://www.flickr.com/search/'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/FootitoBridge.php b/bridges/FootitoBridge.php index ffcba2f..48a8cba 100644 --- a/bridges/FootitoBridge.php +++ b/bridges/FootitoBridge.php @@ -41,12 +41,4 @@ class FootitoBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getName(){ - return 'footito'; - } - - public function getURI(){ - return 'http://www.footito.fr/'; - } } diff --git a/bridges/FourchanBridge.php b/bridges/FourchanBridge.php index 2cb8b00..df4efba 100644 --- a/bridges/FourchanBridge.php +++ b/bridges/FourchanBridge.php @@ -7,7 +7,7 @@ class FourchanBridge extends BridgeAbstract{ $this->name = "4chan"; $this->uri = "https://www.4chan.org/"; $this->description = "Returns posts from the specified thread"; - $this->update = "2015-02-01"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -60,14 +60,6 @@ class FourchanBridge extends BridgeAbstract{ $this->items = array_reverse($this->items); } - public function getName(){ - return '4chan'; - } - - public function getURI(){ - return 'https://www.4chan.org/'; - } - public function getCacheDuration(){ return 300; // 5min } diff --git a/bridges/GBAtempBridge.php b/bridges/GBAtempBridge.php index b1ac17d..94ea2e2 100644 --- a/bridges/GBAtempBridge.php +++ b/bridges/GBAtempBridge.php @@ -7,7 +7,7 @@ class GBAtempBridge extends BridgeAbstract { $this->maintainer = 'ORelio'; $this->name = 'GBAtemp'; - $this->uri = $this->getURI(); + $this->uri = 'http://gbatemp.net/'; $this->description = 'GBAtemp is a user friendly underground video game community.'; $this->update = '2016-08-09'; @@ -91,20 +91,20 @@ class GBAtempBridge extends BridgeAbstract { } else $this->returnError('The provided type filter is invalid. Expecting N, R, T, or F.', 400); } else $this->returnError('Please provide a type filter. Expecting N, R, T, or F.', 400); - $html = $this->file_get_html($this->getURI()) or $this->returnError('Could not request GBAtemp.', 500); + $html = $this->file_get_html($this->uri) or $this->returnError('Could not request GBAtemp.', 500); if ($typeFilter == 'N') { foreach ($html->find('li[class=news_item full]') as $newsItem) { - $url = $this->getURI().$newsItem->find('a', 0)->href; + $url = $this->uri.$newsItem->find('a', 0)->href; $time = intval($this->ExtractFromDelimiters($newsItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"')); $author = $newsItem->find('a.username', 0)->plaintext; $title = $newsItem->find('a', 1)->plaintext; - $content = $this->fetch_post_content($url, $this->getURI()); + $content = $this->fetch_post_content($url, $this->uri); $this->items[] = $this->build_item($url, $title, $author, $time, $content); } } else if ($typeFilter == 'R') { foreach ($html->find('li.portal_review') as $reviewItem) { - $url = $this->getURI().$reviewItem->find('a', 0)->href; + $url = $this->uri.$reviewItem->find('a', 0)->href; $title = $reviewItem->find('span.review_title', 0)->plaintext; $content = $this->file_get_html($url) or $this->returnError('Could not request GBAtemp: '.$uri, 500); $author = $content->find('a.username', 0)->plaintext; @@ -114,25 +114,25 @@ class GBAtempBridge extends BridgeAbstract { $subheader = '

'.$content->find('div.review_subheader', 0)->plaintext.'

'; $procons = $content->find('table.review_procons', 0)->outertext; $scores = $content->find('table.reviewscores', 0)->outertext; - $content = $this->cleanup_post_content($intro.$review.$subheader.$procons.$scores, $this->getURI()); + $content = $this->cleanup_post_content($intro.$review.$subheader.$procons.$scores, $this->uri); $this->items[] = $this->build_item($url, $title, $author, $time, $content); } } else if ($typeFilter == 'T') { foreach ($html->find('li.portal-tutorial') as $tutorialItem) { - $url = $this->getURI().$tutorialItem->find('a', 0)->href; + $url = $this->uri.$tutorialItem->find('a', 0)->href; $title = $tutorialItem->find('a', 0)->plaintext; $time = intval($this->ExtractFromDelimiters($tutorialItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"')); $author = $tutorialItem->find('a.username', 0)->plaintext; - $content = $this->fetch_post_content($url, $this->getURI()); + $content = $this->fetch_post_content($url, $this->uri); $this->items[] = $this->build_item($url, $title, $author, $time, $content); } } else if ($typeFilter == 'F') { foreach ($html->find('li.rc_item') as $postItem) { - $url = $this->getURI().$postItem->find('a', 1)->href; + $url = $this->uri.$postItem->find('a', 1)->href; $title = $postItem->find('a', 1)->plaintext; $time = intval($this->ExtractFromDelimiters($postItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"')); $author = $postItem->find('a.username', 0)->plaintext; - $content = $this->fetch_post_content($url, $this->getURI()); + $content = $this->fetch_post_content($url, $this->uri); $this->items[] = $this->build_item($url, $title, $author, $time, $content); } } @@ -142,10 +142,6 @@ class GBAtempBridge extends BridgeAbstract { return 'GBAtemp'.(empty($this->filter) ? '' : ' '.$this->filter).' Bridge'; } - public function getURI() { - return 'http://gbatemp.net/'; - } - public function getCacheDuration() { return ($this->filter === 'Forum') ? 300 : 3600; // 5 minutes / 1 hour } diff --git a/bridges/GelbooruBridge.php b/bridges/GelbooruBridge.php index e4cd2b5..59ac38b 100644 --- a/bridges/GelbooruBridge.php +++ b/bridges/GelbooruBridge.php @@ -50,14 +50,6 @@ class GelbooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Gelbooru'; - } - - public function getURI(){ - return 'http://gelbooru.com/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/GiphyBridge.php b/bridges/GiphyBridge.php index acc01d2..4ac77e2 100644 --- a/bridges/GiphyBridge.php +++ b/bridges/GiphyBridge.php @@ -9,7 +9,7 @@ class GiphyBridge extends BridgeAbstract{ $this->name = "Giphy Bridge"; $this->uri = "http://giphy.com/"; $this->description = "Bridge for giphy.com"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters["By tag"] = '[ @@ -81,14 +81,6 @@ class GiphyBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Giphy Bridge'; - } - - public function getURI(){ - return 'http://giphy.com/'; - } - public function getCacheDuration(){ return 300; // 5 minutes } diff --git a/bridges/GithubIssueBridge.php b/bridges/GithubIssueBridge.php index 84b1f56..28b19da 100644 --- a/bridges/GithubIssueBridge.php +++ b/bridges/GithubIssueBridge.php @@ -53,14 +53,6 @@ class GithubIssueBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Github Issue'; - } - - public function getURI(){ - return ''; - } - public function getCacheDuration(){ return 600; // ten minutes } diff --git a/bridges/GitlabCommitsBridge.php b/bridges/GitlabCommitsBridge.php index ba1b002..c08bc8d 100644 --- a/bridges/GitlabCommitsBridge.php +++ b/bridges/GitlabCommitsBridge.php @@ -79,12 +79,4 @@ class GitlabCommitsBridge extends BridgeAbstract{ $this->items[]=$item; } } - - public function getName(){ - return 'Gitlab Commits'; - } - - public function getURI(){ - return ''; - } } diff --git a/bridges/GizmodoFRBridge.php b/bridges/GizmodoFRBridge.php index 2c4080f..1204e9f 100644 --- a/bridges/GizmodoFRBridge.php +++ b/bridges/GizmodoFRBridge.php @@ -7,7 +7,7 @@ class GizmodoFRBridge extends BridgeAbstract{ $this->name = "GizmodoFR"; $this->uri = "http://www.gizmodo.fr/"; $this->description = "Returns the 15 newest posts from GizmodoFR (full text)."; - $this->update = "2014-07-14"; + $this->update = "2016-08-09"; } @@ -43,14 +43,6 @@ class GizmodoFRBridge extends BridgeAbstract{ } - public function getName(){ - return 'GizmodoFR'; - } - - public function getURI(){ - return 'http://www.gizmodo.fr/'; - } - public function getCacheDuration(){ return 1800; // 30min } diff --git a/bridges/GoogleSearchBridge.php b/bridges/GoogleSearchBridge.php index 1745922..30e8815 100644 --- a/bridges/GoogleSearchBridge.php +++ b/bridges/GoogleSearchBridge.php @@ -17,7 +17,7 @@ class GoogleSearchBridge extends BridgeAbstract{ $this->name = "Google search"; $this->uri = "https://www.google.com/"; $this->description = "Returns most recent results from Google search."; - $this->update = "2014-05-25"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -62,10 +62,6 @@ class GoogleSearchBridge extends BridgeAbstract{ return (!empty($this->request) ? $this->request .' - ' : '') .'Google search'; } - public function getURI(){ - return 'http://google.com'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/GuruMedBridge.php b/bridges/GuruMedBridge.php index 57252a0..92a4454 100644 --- a/bridges/GuruMedBridge.php +++ b/bridges/GuruMedBridge.php @@ -6,7 +6,7 @@ class GuruMedBridge extends BridgeAbstract{ $this->name = "GuruMed"; $this->uri = "http://www.gurumed.org"; $this->description = "Returns the 5 newest posts from Gurumed (full text)"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function GurumedStripCDATA($string) { @@ -31,12 +31,4 @@ class GuruMedBridge extends BridgeAbstract{ } } } - - public function getName(){ - return 'Gurumed'; - } - - public function getURI(){ - return 'http://gurumed.org/'; - } } diff --git a/bridges/HDWallpapersBridge.php b/bridges/HDWallpapersBridge.php index 99161a3..7a60e5b 100644 --- a/bridges/HDWallpapersBridge.php +++ b/bridges/HDWallpapersBridge.php @@ -77,10 +77,6 @@ class HDWallpapersBridge extends BridgeAbstract { return 'HDWallpapers - '.str_replace(['__', '_'], [' & ', ' '], $this->category).' ['.$this->resolution.']'; } - public function getURI(){ - return 'http://www.hdwallpapers.in'; - } - public function getCacheDuration(){ return 43200; // 12 hours } diff --git a/bridges/HentaiHavenBridge.php b/bridges/HentaiHavenBridge.php index ccd1f08..b3ea196 100644 --- a/bridges/HentaiHavenBridge.php +++ b/bridges/HentaiHavenBridge.php @@ -15,7 +15,7 @@ class HentaiHavenBridge extends BridgeAbstract{ $html = $this->file_get_html('http://hentaihaven.org/') or $this->returnError('Could not request Hentai Haven.', 404); foreach($html->find('div.zoe-grid') as $element) { $item = new \Item(); - $item->uri = $this->getURI().$element->find('div.brick-content h3 a', 0)->href; + $item->uri = $element->find('div.brick-content h3 a', 0)->href; $thumbnailUri = $element->find('a.thumbnail-image img', 0)->getAttribute('data-src'); $item->title = mb_convert_encoding(trim($element->find('div.brick-content h3 a', 0)->innertext), 'UTF-8', 'HTML-ENTITIES'); $item->tags = $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent span.tags', 0)->plaintext; @@ -23,12 +23,7 @@ class HentaiHavenBridge extends BridgeAbstract{ $this->items[] = $item; } } - public function getName(){ - return 'Hentai Haven'; - } - public function getURI(){ - return ''; - } + public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php index 104022b..2c50003 100644 --- a/bridges/InstagramBridge.php +++ b/bridges/InstagramBridge.php @@ -9,7 +9,7 @@ class InstagramBridge extends BridgeAbstract{ $this->name = "Instagram Bridge"; $this->uri = "http://instagram.com/"; $this->description = "Returns the newest images"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -77,8 +77,4 @@ class InstagramBridge extends BridgeAbstract{ public function getName(){ return (!empty($this->request) ? $this->request .' - ' : '') .'Instagram Bridge'; } - - public function getURI(){ - return 'http://instagram.com/'; - } } diff --git a/bridges/JapanExpoBridge.php b/bridges/JapanExpoBridge.php index 1c7afa7..afff948 100644 --- a/bridges/JapanExpoBridge.php +++ b/bridges/JapanExpoBridge.php @@ -3,7 +3,7 @@ class JapanExpoBridge extends BridgeAbstract{ public function loadMetadatas() { $this->maintainer = 'Ginko'; - $this->name = 'JapanExpo'; + $this->name = 'Japan Expo Actualités'; $this->uri = 'http://www.japan-expo-paris.com/fr/actualites'; $this->description = 'Returns most recent entries from Japan Expo actualités.'; $this->update = '2016-08-09'; @@ -102,14 +102,6 @@ class JapanExpoBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Japan Expo Actualités'; - } - - public function getURI(){ - return 'http://www.japan-expo-paris.com/fr/actualites'; - } - public function getCacheDuration(){ return 14400; // 4 hours } diff --git a/bridges/KonachanBridge.php b/bridges/KonachanBridge.php index 1b3a378..45227a4 100644 --- a/bridges/KonachanBridge.php +++ b/bridges/KonachanBridge.php @@ -50,14 +50,6 @@ class KonachanBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Konachan'; - } - - public function getURI(){ - return 'http://konachan.com/post'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/KoreusBridge.php b/bridges/KoreusBridge.php index 830d75f..15bcaa1 100644 --- a/bridges/KoreusBridge.php +++ b/bridges/KoreusBridge.php @@ -6,7 +6,7 @@ class KoreusBridge extends BridgeAbstract{ $this->name = "Koreus"; $this->uri = "http://www.koreus.com/"; $this->description = "Returns the 5 newest posts from Koreus (full text)"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function KoreusStripCDATA($string) { @@ -38,12 +38,4 @@ class KoreusBridge extends BridgeAbstract{ } } } - - public function getName(){ - return 'Koreus'; - } - - public function getURI(){ - return 'http://www.koreus.com/'; - } } diff --git a/bridges/LWNprevBridge.php b/bridges/LWNprevBridge.php index 15bc1f2..52d7172 100644 --- a/bridges/LWNprevBridge.php +++ b/bridges/LWNprevBridge.php @@ -160,14 +160,6 @@ class LWNprevBridge extends BridgeAbstract{ } } - public function getName(){ - return 'LWN Free Weekly Edition'; - } - - public function getURI(){ - return 'https://lwn.net/free/bigpage'; - } - public function getCacheDuration(){ return 604800; // one week } diff --git a/bridges/LeBonCoinBridge.php b/bridges/LeBonCoinBridge.php index e6d0427..98a45be 100755 --- a/bridges/LeBonCoinBridge.php +++ b/bridges/LeBonCoinBridge.php @@ -7,7 +7,7 @@ class LeBonCoinBridge extends BridgeAbstract{ $this->name = "LeBonCoin"; $this->uri = "http://www.leboncoin.fr"; $this->description = "Returns most recent results from LeBonCoin for a region, and optionally a category and a keyword ."; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -275,12 +275,4 @@ class LeBonCoinBridge extends BridgeAbstract{ $this->items[] = $item; } } - - public function getName(){ - return 'LeBonCoin'; - } - - public function getURI(){ - return 'http://www.leboncoin.fr'; - } } \ No newline at end of file diff --git a/bridges/LeJournalDuGeekBridge.php b/bridges/LeJournalDuGeekBridge.php index 0b6407b..d30853c 100644 --- a/bridges/LeJournalDuGeekBridge.php +++ b/bridges/LeJournalDuGeekBridge.php @@ -6,7 +6,7 @@ class LeJournalDuGeekBridge extends BridgeAbstract{ $this->name = "journaldugeek.com (FR)"; $this->uri = "http://www.journaldugeek.com/"; $this->description = "Returns the 5 newest posts from LeJournalDuGeek (full text)."; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function LeJournalDuGeekStripCDATA($string) { @@ -54,14 +54,6 @@ class LeJournalDuGeekBridge extends BridgeAbstract{ } } - public function getName(){ - return 'LeJournalDuGeek'; - } - - public function getURI(){ - return 'http://www.journaldugeek.com/'; - } - public function getCacheDuration(){ return 1800; // 30min } diff --git a/bridges/LeMondeInformatiqueBridge.php b/bridges/LeMondeInformatiqueBridge.php index df81b66..2ee1c42 100644 --- a/bridges/LeMondeInformatiqueBridge.php +++ b/bridges/LeMondeInformatiqueBridge.php @@ -61,14 +61,6 @@ class LeMondeInformatiqueBridge extends BridgeAbstract { } } - public function getName() { - return 'Le Monde Informatique'; - } - - public function getURI() { - return 'http://www.lemondeinformatique.fr/'; - } - public function getCacheDuration() { return 1800; // 30 minutes } diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php index 4ff8e2c..ed14be9 100644 --- a/bridges/LesJoiesDuCodeBridge.php +++ b/bridges/LesJoiesDuCodeBridge.php @@ -48,14 +48,6 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Les Joies Du Code'; - } - - public function getURI(){ - return 'http://lesjoiesducode.fr/'; - } - public function getCacheDuration(){ return 7200; // 2h hours } diff --git a/bridges/LinkedInCompany.php b/bridges/LinkedInCompany.php index 243f70c..97e3643 100644 --- a/bridges/LinkedInCompany.php +++ b/bridges/LinkedInCompany.php @@ -37,14 +37,6 @@ class LinkedInCompany extends BridgeAbstract{ } } - public function getName(){ - return 'LinkedIn'; - } - - public function getURI(){ - return 'https://www.linkedin.com'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/LolibooruBridge.php b/bridges/LolibooruBridge.php index 74fe9ab..3d4745b 100644 --- a/bridges/LolibooruBridge.php +++ b/bridges/LolibooruBridge.php @@ -51,14 +51,6 @@ class LolibooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Lolibooru'; - } - - public function getURI(){ - return 'http://lolibooru.moe/post'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/MangareaderBridge.php b/bridges/MangareaderBridge.php index 568eb23..e8d53f4 100644 --- a/bridges/MangareaderBridge.php +++ b/bridges/MangareaderBridge.php @@ -328,10 +328,6 @@ class MangareaderBridge extends BridgeAbstract{ return (!empty($this->request) ? $this->request . ' - ' : '') . 'Mangareader Bridge'; } - public function getURI(){ - return 'http://www.mangareader.net'; - } - public function getCacheDuration(){ return 10800; // 3 hours } diff --git a/bridges/MilbooruBridge.php b/bridges/MilbooruBridge.php index 946a132..59a7b26 100644 --- a/bridges/MilbooruBridge.php +++ b/bridges/MilbooruBridge.php @@ -47,14 +47,6 @@ class MilbooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Milbooru'; - } - - public function getURI(){ - return 'http://sheslostcontrol.net/moe/shimmie/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/MondeDiploBridge.php b/bridges/MondeDiploBridge.php index 2aad1a4..d6d2d3b 100644 --- a/bridges/MondeDiploBridge.php +++ b/bridges/MondeDiploBridge.php @@ -3,33 +3,25 @@ class MondeDiploBridge extends BridgeAbstract{ public function loadMetadatas() { $this->maintainer = "Pitchoule"; - $this->name = "MondeDiplo"; - $this->uri = "http://www.monde-diplomatique.fr"; + $this->name = 'Monde Diplomatique'; + $this->uri = 'http://www.monde-diplomatique.fr'; $this->description = "Returns most recent results from MondeDiplo."; - $this->update = "2016-08-03"; + $this->update = "2016-08-09"; } public function collectData(array $param){ - $html = $this->file_get_html($this->getURI()) or $this->returnError('Could not request MondeDiplo. for : ' . $link , 404); + $html = $this->file_get_html($this->uri) or $this->returnError('Could not request MondeDiplo. for : ' . $link , 404); foreach($html->find('div.unarticle') as $article) { $element = $article->parent(); $item = new Item(); - $item->uri = $this->getURI() . $element->href; + $item->uri = $this->uri . $element->href; $item->title = $element->find('h3', 0)->plaintext; $item->content = $element->find('div.dates_auteurs', 0)->plaintext . '
' . strstr($element->find('div', 0)->plaintext, $element->find('div.dates_auteurs', 0)->plaintext, true); $this->items[] = $item; } } - public function getName(){ - return 'Monde Diplomatique'; - } - - public function getURI(){ - return 'http://www.monde-diplomatique.fr'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/MsnMondeBridge.php b/bridges/MsnMondeBridge.php index 4b833c9..03c3eb6 100644 --- a/bridges/MsnMondeBridge.php +++ b/bridges/MsnMondeBridge.php @@ -3,10 +3,10 @@ class MsnMondeBridge extends BridgeAbstract{ public function loadMetadatas() { $this->maintainer = "kranack"; - $this->name = "MSN Actu Monde"; - $this->uri = "http://www.msn.com/fr-fr/actualite/monde"; + $this->name = 'MSN Actu Monde'; + $this->uri = 'http://www.msn.com/fr-fr/actualite/monde'; $this->description = "Returns the 10 newest posts from MSN Actualités (full text)"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function MsnMondeExtractContent($url, &$item) { @@ -16,7 +16,7 @@ class MsnMondeBridge extends BridgeAbstract{ } public function collectData(array $param){ - $html = $this->file_get_html($this->getURI()) or $this->returnError('Could not request MsnMonde.', 404); + $html = $this->file_get_html($this->uri) or $this->returnError('Could not request MsnMonde.', 404); $limit = 0; foreach($html->find('.smalla') as $article) { if($limit < 10) { @@ -29,12 +29,4 @@ class MsnMondeBridge extends BridgeAbstract{ } } } - - public function getName(){ - return 'MSN Actu Monde'; - } - - public function getURI(){ - return 'http://www.msn.com/fr-fr/actualite/monde'; - } } diff --git a/bridges/MspabooruBridge.php b/bridges/MspabooruBridge.php index 2ad84d6..edd327d 100644 --- a/bridges/MspabooruBridge.php +++ b/bridges/MspabooruBridge.php @@ -50,14 +50,6 @@ class MspabooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Mspabooru'; - } - - public function getURI(){ - return 'http://mspabooru.com/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/NasaApodBridge.php b/bridges/NasaApodBridge.php index 9da120a..3c0f256 100644 --- a/bridges/NasaApodBridge.php +++ b/bridges/NasaApodBridge.php @@ -7,7 +7,7 @@ class NasaApodBridge extends BridgeAbstract{ $this->name = "NASA APOD Bridge"; $this->uri = "http://apod.nasa.gov/apod/astropix.html"; $this->description = "Returns the 3 latest NASA APOD pictures and explanations"; - $this->update = "2014-08-27"; + $this->update = "2016-08-09"; } @@ -45,14 +45,6 @@ class NasaApodBridge extends BridgeAbstract{ } } - public function getName(){ - return 'NASA APOD'; - } - - public function getURI(){ - return 'http://apod.nasa.gov/apod/astropix.html'; - } - public function getCacheDuration(){ return 3600*12; // 12 hours } diff --git a/bridges/NeuviemeArtBridge.php b/bridges/NeuviemeArtBridge.php index b772f5d..d26e6f2 100644 --- a/bridges/NeuviemeArtBridge.php +++ b/bridges/NeuviemeArtBridge.php @@ -3,7 +3,7 @@ class NeuviemeArtBridge extends BridgeAbstract { public function loadMetadatas() { $this->maintainer = "ORelio"; - $this->name = "9ème Art"; + $this->name = '9ème Art Bridge'; $this->uri = "http://www.9emeart.fr/"; $this->description = "Returns the newest articles."; $this->update = "2016-08-09"; @@ -54,12 +54,4 @@ class NeuviemeArtBridge extends BridgeAbstract { } } } - - public function getName() { - return '9ème Art Bridge'; - } - - public function getURI() { - return 'http://www.9emeart.fr/'; - } -} \ No newline at end of file +} diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php index 52bc908..3c8b976 100644 --- a/bridges/NextInpactBridge.php +++ b/bridges/NextInpactBridge.php @@ -43,12 +43,4 @@ class NextInpactBridge extends BridgeAbstract { } } } - - public function getName() { - return 'Nextinpact Bridge'; - } - - public function getURI() { - return 'http://www.nextinpact.com/'; - } } diff --git a/bridges/NiceMatinBridge.php b/bridges/NiceMatinBridge.php index aa41822..0a05d06 100644 --- a/bridges/NiceMatinBridge.php +++ b/bridges/NiceMatinBridge.php @@ -6,7 +6,7 @@ class NiceMatinBridge extends BridgeAbstract{ $this->name = "NiceMatin"; $this->uri = "http://www.nicematin.com/"; $this->description = "Returns the 10 newest posts from NiceMatin (full text)"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function NiceMatinExtractContent($url) { @@ -45,12 +45,4 @@ class NiceMatinBridge extends BridgeAbstract{ } } } - - public function getName(){ - return 'NiceMatin'; - } - - public function getURI(){ - return 'http://www.nicematin.com/'; - } } diff --git a/bridges/NovelUpdatesBridge.php b/bridges/NovelUpdatesBridge.php index ff5cd88..e61ebfd 100644 --- a/bridges/NovelUpdatesBridge.php +++ b/bridges/NovelUpdatesBridge.php @@ -7,7 +7,7 @@ class NovelUpdatesBridge extends BridgeAbstract{ $this->name = "Novel Updates"; $this->uri = "http://www.novelupdates.com/"; $this->description = "Returns releases from Novel Updates"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters[] = '[ { @@ -44,12 +44,11 @@ class NovelUpdatesBridge extends BridgeAbstract{ $this->items[] = $item; } } + public function getName(){ return (!empty($this->request) ? $this->request.' - ' : '') .'Novel Updates'; } - public function getURI(){ - return 'http://www.novelupdates.com/'; - } + public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/NumeramaBridge.php b/bridges/NumeramaBridge.php index c8dcb4c..d6248a6 100644 --- a/bridges/NumeramaBridge.php +++ b/bridges/NumeramaBridge.php @@ -7,7 +7,7 @@ class NumeramaBridge extends BridgeAbstract{ $this->name = 'Numerama'; $this->uri = 'http://www.numerama.com/'; $this->description = 'Returns the 5 newest posts from Numerama (full text)'; - $this->update = '2016-07-19'; + $this->update = '2016-08-09'; } @@ -19,7 +19,7 @@ class NumeramaBridge extends BridgeAbstract{ return $string; } - $feed = $this->getURI().'feed/'; + $feed = $this->uri.'feed/'; $html = $this->file_get_html($feed) or $this->returnError('Could not request Numerama: '.$feed, 500); $limit = 0; @@ -45,14 +45,6 @@ class NumeramaBridge extends BridgeAbstract{ } - public function getName() { - return 'Numerama'; - } - - public function getURI() { - return 'http://www.numerama.com/'; - } - public function getCacheDuration() { return 1800; // 30min } diff --git a/bridges/OpenClassroomsBridge.php b/bridges/OpenClassroomsBridge.php index f217fa9..9371b5c 100644 --- a/bridges/OpenClassroomsBridge.php +++ b/bridges/OpenClassroomsBridge.php @@ -7,7 +7,7 @@ class OpenClassroomsBridge extends BridgeAbstract{ $this->name = "OpenClassrooms Bridge"; $this->uri = "https://openclassrooms.com/"; $this->description = "Returns latest tutorials from OpenClassrooms."; - $this->update = "2015-10-30"; + $this->update = "2016-08-09"; $this->parameters[] = @@ -79,14 +79,6 @@ class OpenClassroomsBridge extends BridgeAbstract{ } } - public function getName(){ - return 'OpenClassrooms'; - } - - public function getURI(){ - return 'https://openclassrooms.com/'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/ParuVenduImmoBridge.php b/bridges/ParuVenduImmoBridge.php index 40f4ead..ac9b316 100644 --- a/bridges/ParuVenduImmoBridge.php +++ b/bridges/ParuVenduImmoBridge.php @@ -8,9 +8,9 @@ class ParuVenduImmoBridge extends BridgeAbstract $this->maintainer = "polo2ro"; $this->name = "Paru Vendu Immobilier"; - $this->uri = "http://www.paruvendu.fr/immobilier/"; + $this->uri = "http://www.paruvendu.fr"; $this->description = "Returns the ads from the first page of search result."; - $this->update = "2015-02-02"; + $this->update = "2016-08-09"; $this->parameters[] = @@ -46,7 +46,7 @@ class ParuVenduImmoBridge extends BridgeAbstract $num = 20; $appartment = '&tbApp=1&tbDup=1&tbChb=1&tbLof=1&tbAtl=1&tbPla=1'; $maison = '&tbMai=1&tbVil=1&tbCha=1&tbPro=1&tbHot=1&tbMou=1&tbFer=1'; - $link = $this->getURI().'/immobilier/annonceimmofo/liste/listeAnnonces?tt=1'.$appartment.$maison; + $link = $this->uri.'/immobilier/annonceimmofo/liste/listeAnnonces?tt=1'.$appartment.$maison; if (isset($param['minarea'])) { $this->request .= ' '.$param['minarea'].' m2'; @@ -90,7 +90,7 @@ class ParuVenduImmoBridge extends BridgeAbstract list($href) = explode('#', $element->href); $item = new \Item(); - $item->uri = $this->getURI().$href; + $item->uri = $this->uri.$href; $item->title = $element->title; $item->content = $img.$desc.$price; $this->items[] = $item; @@ -102,10 +102,6 @@ class ParuVenduImmoBridge extends BridgeAbstract return 'Paru Vendu Immobilier'.$this->request; } - public function getURI(){ - return 'http://www.paruvendu.fr'; - } - public function getCacheDuration(){ return 10800; // 3 hours } diff --git a/bridges/PickyWallpapersBridge.php b/bridges/PickyWallpapersBridge.php index b45a61b..29b116c 100644 --- a/bridges/PickyWallpapersBridge.php +++ b/bridges/PickyWallpapersBridge.php @@ -83,10 +83,6 @@ class PickyWallpapersBridge extends BridgeAbstract { return 'PickyWallpapers - '.$this->category.(!empty($this->subcategory) ? ' > '.$this->subcategory : '').' ['.$this->resolution.']'; } - public function getURI(){ - return 'http://www.pickywallpapers.com'; - } - public function getCacheDuration(){ return 43200; // 12 hours } diff --git a/bridges/PlanetLibreBridge.php b/bridges/PlanetLibreBridge.php index cbfa023..53250ea 100644 --- a/bridges/PlanetLibreBridge.php +++ b/bridges/PlanetLibreBridge.php @@ -6,7 +6,7 @@ class PlanetLibreBridge extends BridgeAbstract{ $this->name = "PlanetLibre"; $this->uri = "http://www.planet-libre.org"; $this->description = "Returns the 5 newest posts from PlanetLibre (full text)"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function PlanetLibreExtractContent($url){ @@ -31,12 +31,6 @@ class PlanetLibreBridge extends BridgeAbstract{ } } - public function getName(){ - return 'PlanetLibre'; - } - public function getURI(){ - return 'http://www.planet-libre.org/'; - } public function getCacheDuration(){ return 3600*2; // 1 hour } diff --git a/bridges/ProjectMGameBridge.php b/bridges/ProjectMGameBridge.php index b9835c9..19c2e61 100644 --- a/bridges/ProjectMGameBridge.php +++ b/bridges/ProjectMGameBridge.php @@ -7,7 +7,7 @@ class ProjectMGameBridge extends BridgeAbstract{ $this->name = "Project M Game Bridge"; $this->uri = "http://projectmgame.com/en/"; $this->description = "Returns the newest articles."; - $this->update = "2014-08-27"; + $this->update = "2016-08-09"; } @@ -33,14 +33,6 @@ class ProjectMGameBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Project M Game Bridge'; - } - - public function getURI(){ - return 'http://projectmgame.com/en/'; - } - public function getCacheDuration(){ return 10800; //3 hours } diff --git a/bridges/RTBFBridge.php b/bridges/RTBFBridge.php index 2eb2d98..d96dd27 100644 --- a/bridges/RTBFBridge.php +++ b/bridges/RTBFBridge.php @@ -52,10 +52,6 @@ class RTBFBridge extends BridgeAbstract { return (!empty($this->request) ? $this->request .' - ' : '') .'RTBF Bridge'; } - public function getURI(){ - return 'http://www.rtbf.be/auvio/emissions'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/Releases3DSBridge.php b/bridges/Releases3DSBridge.php index 54a5a81..3c5c74e 100644 --- a/bridges/Releases3DSBridge.php +++ b/bridges/Releases3DSBridge.php @@ -118,14 +118,6 @@ class Releases3DSBridge extends BridgeAbstract { } } - public function getName() { - return '3DS Scene Releases'; - } - - public function getURI() { - return 'http://www.3dsdb.com/'; - } - public function getCacheDuration() { return 10800; //3 hours } diff --git a/bridges/ReporterreBridge.php b/bridges/ReporterreBridge.php index 702f13d..387316e 100644 --- a/bridges/ReporterreBridge.php +++ b/bridges/ReporterreBridge.php @@ -6,7 +6,7 @@ class ReporterreBridge extends BridgeAbstract{ $this->name = "Reporterre Bridge"; $this->uri = "http://www.reporterre.net/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } private function ExtractContentReporterre($url) { @@ -20,7 +20,7 @@ class ReporterreBridge extends BridgeAbstract{ unset ($html2); // Replace all relative urls with absolute ones - $text = preg_replace('/(href|src)(\=[\"\'])(?!http)([^"\']+)/ims', "$1$2" . $this->getURI() . "$3", $text); + $text = preg_replace('/(href|src)(\=[\"\'])(?!http)([^"\']+)/ims', "$1$2" . $this->uri . "$3", $text); $text = strip_tags($text, '


'); return $text; @@ -42,12 +42,4 @@ class ReporterreBridge extends BridgeAbstract{ } } } - - public function getName(){ - return 'Reporterre Bridge'; - } - - public function getURI(){ - return 'http://www.reporterre.net/'; - } } diff --git a/bridges/Rue89Bridge.php b/bridges/Rue89Bridge.php index 2a2b8f1..ae407d3 100644 --- a/bridges/Rue89Bridge.php +++ b/bridges/Rue89Bridge.php @@ -7,7 +7,7 @@ class Rue89Bridge extends BridgeAbstract{ $this->name = "Rue89"; $this->uri = "http://rue89.nouvelobs.com/"; $this->description = "Returns the 5 newest posts from Rue89 (full text)"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; } @@ -44,10 +44,4 @@ class Rue89Bridge extends BridgeAbstract{ } } - public function getName(){ - return 'Rue89'; - } - public function getURI(){ - return 'http://rue89.nouvelobs.com/'; - } } diff --git a/bridges/Rule34Bridge.php b/bridges/Rule34Bridge.php index d9ca066..3b22d43 100644 --- a/bridges/Rule34Bridge.php +++ b/bridges/Rule34Bridge.php @@ -49,14 +49,6 @@ class Rule34Bridge extends BridgeAbstract{ } } - public function getName(){ - return 'Rule34'; - } - - public function getURI(){ - return 'http://rule34.xxx/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/Rule34pahealBridge.php b/bridges/Rule34pahealBridge.php index ecffcc5..e6e135e 100644 --- a/bridges/Rule34pahealBridge.php +++ b/bridges/Rule34pahealBridge.php @@ -48,14 +48,6 @@ class Rule34pahealBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Rule34paheal'; - } - - public function getURI(){ - return 'http://rule34.paheal.net/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/SafebooruBridge.php b/bridges/SafebooruBridge.php index b9d2ee1..42272f8 100644 --- a/bridges/SafebooruBridge.php +++ b/bridges/SafebooruBridge.php @@ -50,14 +50,6 @@ class SafebooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Safebooru'; - } - - public function getURI(){ - return 'http://safebooru.org/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/SakugabooruBridge.php b/bridges/SakugabooruBridge.php index ac6d58d..5e6e529 100644 --- a/bridges/SakugabooruBridge.php +++ b/bridges/SakugabooruBridge.php @@ -50,14 +50,6 @@ class SakugabooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Sakugabooru'; - } - - public function getURI(){ - return 'http://sakuga.yshi.org/post'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/ScmbBridge.php b/bridges/ScmbBridge.php index 6cf9673..95bd544 100644 --- a/bridges/ScmbBridge.php +++ b/bridges/ScmbBridge.php @@ -7,7 +7,7 @@ class ScmbBridge extends BridgeAbstract{ $this->name = "Se Coucher Moins Bête Bridge"; $this->uri = "http://secouchermoinsbete.fr/"; $this->description = "Returns the newest anecdotes."; - $this->update = "2014-05-25"; + $this->update = "2016-08-09"; } @@ -38,14 +38,6 @@ class ScmbBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Se Coucher Moins Bête Bridge'; - } - - public function getURI(){ - return 'http://secouchermoinsbete.fr/'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/ScoopItBridge.php b/bridges/ScoopItBridge.php index da439de..449f8d1 100644 --- a/bridges/ScoopItBridge.php +++ b/bridges/ScoopItBridge.php @@ -7,7 +7,7 @@ class ScoopItBridge extends BridgeAbstract{ $this->name = "ScoopIt"; $this->uri = "http://www.scoop.it"; $this->description = "Returns most recent results from ScoopIt."; - $this->update = "2014-06-13"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -39,14 +39,6 @@ class ScoopItBridge extends BridgeAbstract{ } } - public function getName(){ - return 'ScooptIt'; - } - - public function getURI(){ - return 'http://Scoop.it'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/SensCritiqueBridge.php b/bridges/SensCritiqueBridge.php index fc20932..1b7a95e 100644 --- a/bridges/SensCritiqueBridge.php +++ b/bridges/SensCritiqueBridge.php @@ -131,10 +131,6 @@ class SensCritiqueBridge extends BridgeAbstract { } } - public function getURI() { - return (trim($this->uri) === "") ? "http://www.senscritique.com" : $this->uri; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/Sexactu.php b/bridges/Sexactu.php index c5480e4..d9f70c4 100644 --- a/bridges/Sexactu.php +++ b/bridges/Sexactu.php @@ -1,5 +1,4 @@ find('h2', 0)->find('a',0); $titleTimestamp =$titleDetails->find('h4',0); $item->title = $this->correctCase(trim($titleData->innertext)); - $item->uri = GQ.$titleData->href; + $item->uri = $this->uri.$titleData->href; // Fugly date parsing due to the fact my DNS-323 doesn't support php intl extension $dateText = $titleTimestamp->innertext; @@ -46,7 +45,7 @@ $replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July', $elementText = $element->find('.text-container', 0); // don't forget to replace images server url with gq one foreach($elementText->find('img') as $image) { - $image->src = GQ.$image->src; + $image->src = $this->uri.$image->src; } $item->content = $elementText->innertext; $this->items[] = $item; @@ -58,12 +57,8 @@ $replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July', } } - public function getName(){ - return 'Sexactu'; - } - public function getURI(){ - return GQ.'/sexactu'; + return $this->uri.'/sexactu'; } public function getCacheDuration(){ diff --git a/bridges/SiliconBridge.php b/bridges/SiliconBridge.php index 4cd7388..0805e8d 100644 --- a/bridges/SiliconBridge.php +++ b/bridges/SiliconBridge.php @@ -4,8 +4,8 @@ class SiliconBridge extends BridgeAbstract { public function loadMetadatas() { $this->maintainer = "ORelio"; - $this->name = "Silicon.fr"; - $this->uri = "http://www.silicon.fr/"; + $this->name = 'Silicon Bridge'; + $this->uri = 'http://www.silicon.fr/'; $this->description = "Returns the newest articles."; $this->update = "2016-08-09"; @@ -58,16 +58,7 @@ class SiliconBridge extends BridgeAbstract { } } - public function getName() { - return 'Silicon Bridge'; - } - - public function getURI() { - return 'http://www.silicon.fr/'; - } - public function getCacheDuration() { return 1800; // 30 minutes - // return 0; } } diff --git a/bridges/StripeAPIChangeLogBridge.php b/bridges/StripeAPIChangeLogBridge.php index 1a5b57f..32945a1 100644 --- a/bridges/StripeAPIChangeLogBridge.php +++ b/bridges/StripeAPIChangeLogBridge.php @@ -10,7 +10,7 @@ class StripeAPIChangeLogBridge extends BridgeAbstract{ $this->maintainer = 'Pierre Mazière'; $this->name = 'Stripe API Changelog'; - $this->uri = ''; + $this->uri = 'https://stripe.com/docs/upgrades'; $this->description = 'Returns the changes made to the stripe.com API'; $this->update = '2016-08-09'; } @@ -31,14 +31,6 @@ class StripeAPIChangeLogBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Stripe API Changelog'; - } - - public function getURI(){ - return 'https://stripe.com/docs/upgrades'; - } - public function getCacheDuration(){ return 86400; // one day } diff --git a/bridges/SuperbWallpapersBridge.php b/bridges/SuperbWallpapersBridge.php index ed9d78f..2d21cfa 100644 --- a/bridges/SuperbWallpapersBridge.php +++ b/bridges/SuperbWallpapersBridge.php @@ -75,10 +75,6 @@ class SuperbWallpapersBridge extends BridgeAbstract { return 'HDWallpapers - '.$this->category.' ['.$this->resolution.']'; } - public function getURI(){ - return 'http://www.superbwallpapers.com'; - } - public function getCacheDuration(){ return 43200; // 12 hours } diff --git a/bridges/T411Bridge.php b/bridges/T411Bridge.php index 5a7e2bc..0238f33 100644 --- a/bridges/T411Bridge.php +++ b/bridges/T411Bridge.php @@ -4,8 +4,8 @@ class T411Bridge extends BridgeAbstract { public function loadMetadatas() { $this->maintainer = 'ORelio'; - $this->name = 'T411'; - $this->uri = $this->getURI(); + $this->name = 'T411 Bridge'; + $this->uri = 'https://t411.ch/'; $this->description = 'Returns the 10 newest torrents with specified search terms
Use url part after "?" mark when using their search engine.'; $this->update = '2016-08-09'; @@ -35,7 +35,7 @@ class T411Bridge extends BridgeAbstract { } //Retrieve torrent listing from search results, which does not contain torrent description - $url = $this->getURI().'torrents/search/?'.$param['search'].'&order=added&type=desc'; + $url = $this->uri.'torrents/search/?'.$param['search'].'&order=added&type=desc'; $html = $this->file_get_html($url) or $this->returnError('Could not request t411: '.$url, 500); $results = $html->find('table.results', 0); if (is_null($results)) @@ -52,7 +52,7 @@ class T411Bridge extends BridgeAbstract { usleep(500000); //So we need to wait (500ms) //Retrieve data from RSS entry - $item_uri = $this->getURI().'torrents/details/?id='.ExtractFromDelimiters($element->find('a.nfo', 0)->outertext, '?id=', '"'); + $item_uri = $this->uri.'torrents/details/?id='.ExtractFromDelimiters($element->find('a.nfo', 0)->outertext, '?id=', '"'); $item_title = ExtractFromDelimiters($element->outertext, '" title="', '"'); $item_date = strtotime($element->find('dd', 0)->plaintext); @@ -84,13 +84,5 @@ class T411Bridge extends BridgeAbstract { } } } - - public function getName() { - return "T411 Bridge"; - } - - public function getURI() { - return 'https://t411.ch/'; - } } diff --git a/bridges/TagBoardBridge.php b/bridges/TagBoardBridge.php index 406f64f..b2a94ea 100644 --- a/bridges/TagBoardBridge.php +++ b/bridges/TagBoardBridge.php @@ -45,10 +45,6 @@ class TagBoardBridge extends BridgeAbstract{ return 'tagboard - ' .$this->request; } - public function getURI(){ - return 'http://TagBoard.com'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/TbibBridge.php b/bridges/TbibBridge.php index f0c91c7..e624c69 100644 --- a/bridges/TbibBridge.php +++ b/bridges/TbibBridge.php @@ -49,14 +49,6 @@ class TbibBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Tbib'; - } - - public function getURI(){ - return 'http://tbib.org/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/TheCodingLoveBridge.php b/bridges/TheCodingLoveBridge.php index 6e8702b..e2ff360 100644 --- a/bridges/TheCodingLoveBridge.php +++ b/bridges/TheCodingLoveBridge.php @@ -49,14 +49,6 @@ class TheCodingLoveBridge extends BridgeAbstract{ } } - public function getName(){ - return 'The Coding Love'; - } - - public function getURI(){ - return 'http://thecodinglove.com/'; - } - public function getCacheDuration(){ return 7200; // 2h hours } diff --git a/bridges/ThePirateBayBridge.php b/bridges/ThePirateBayBridge.php index c8b8b68..4e2bd05 100644 --- a/bridges/ThePirateBayBridge.php +++ b/bridges/ThePirateBayBridge.php @@ -7,7 +7,7 @@ class ThePirateBayBridge extends BridgeAbstract{ $this->name = "The Pirate Bay"; $this->uri = "https://thepiratebay.org/"; $this->description = "Returns results for the keywords. You can put several list of keywords by separating them with a semicolon (e.g. \"one show;another show\")"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -80,12 +80,4 @@ class ThePirateBayBridge extends BridgeAbstract{ } } } - - public function getName(){ - return 'The Pirate Bay'; - } - - public function getURI(){ - return 'https://thepiratebay.org/'; - } } diff --git a/bridges/TwitchApiBridge.php b/bridges/TwitchApiBridge.php index adebd05..789324a 100644 --- a/bridges/TwitchApiBridge.php +++ b/bridges/TwitchApiBridge.php @@ -164,10 +164,6 @@ class TwitchApiBridge extends BridgeAbstract{ return (!empty($this->channel) ? $this->channel . ' - ' : '') . 'Twitch API Bridge'; } - public function getURI(){ - return 'https://www.twitch.tv'; - } - public function getCacheDuration(){ return 10800; // 3 hours } diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index c116713..4a7ec9d 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -10,7 +10,7 @@ class TwitterBridge extends BridgeAbstract{ $this->name = "Twitter Bridge"; $this->uri = "http://twitter.com/"; $this->description = "Returns user timelines or keyword/hashtag search results (without using their API)."; - $this->update = "2014-05-25"; + $this->update = "2016-08-09"; $this->parameters["By keyword or hashtag"] = '[ @@ -74,10 +74,6 @@ class TwitterBridge extends BridgeAbstract{ return (!empty($this->request) ? $this->request .' - ' : '') .'Twitter Bridge'; } - public function getURI(){ - return 'http://twitter.com'; - } - public function getCacheDuration(){ return 300; // 5 minutes } diff --git a/bridges/TwitterBridgeClean.php b/bridges/TwitterBridgeClean.php index 9f6ccfc..235469c 100644 --- a/bridges/TwitterBridgeClean.php +++ b/bridges/TwitterBridgeClean.php @@ -10,7 +10,7 @@ class TwitterBridgeClean extends BridgeAbstract{ $this->name = "Twitter Bridge Clean"; $this->uri = "http://twitter.com/"; $this->description = "Returns user timelines without username in title or search results for keywords/hashtags (without using their API)."; - $this->update = "2015-03-07"; + $this->update = "2016-08-09"; $this->parameters["By keyword or hashtag"] = '[ @@ -75,10 +75,6 @@ class TwitterBridgeClean extends BridgeAbstract{ return (!empty($this->request) ? $this->request .' - ' : '') .'Twitter Bridge'; } - public function getURI(){ - return 'http://twitter.com'; - } - public function getCacheDuration(){ return 300; // 5 minutes } diff --git a/bridges/TwitterBridgeCleanExtended.php b/bridges/TwitterBridgeCleanExtended.php index 170efff..1be4c7b 100644 --- a/bridges/TwitterBridgeCleanExtended.php +++ b/bridges/TwitterBridgeCleanExtended.php @@ -10,7 +10,7 @@ class TwitterBridgeCleanExtended extends BridgeAbstract{ $this->name = "Twitter Bridge Clean Extended"; $this->uri = "http://twitter.com/"; $this->description = "Returns user timelines showing RTs correctly or search results for keywords/hashtags (without using their API)."; - $this->update = "2016-01-27"; + $this->update = "2016-08-09"; $this->parameters["By keyword or hashtag"] = '[ @@ -80,10 +80,6 @@ class TwitterBridgeCleanExtended extends BridgeAbstract{ return (!empty($this->request) ? $this->request : ''); } - public function getURI(){ - return 'http://twitter.com'; - } - public function getCacheDuration(){ return 300; // 5 minutes } diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index e15a0e9..b824a72 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -7,7 +7,7 @@ class TwitterBridgeExtended extends BridgeAbstract{ $this->name = "Twitter Bridge Extended"; $this->uri = "https://twitter.com/"; $this->description = "(same as Twitter Bridge, but with avatar, replies and RTs)"; - $this->update = "2014-05-25"; + $this->update = "2016-08-09"; $this->parameters["By keyword or hashtag"] = '[ @@ -78,14 +78,6 @@ class TwitterBridgeExtended extends BridgeAbstract{ } } - public function getName(){ - return 'Twitter Bridge Extended'; - } - - public function getURI(){ - return 'http://twitter.com'; - } - public function getCacheDuration(){ return 300; // 5 minutes } diff --git a/bridges/TwitterBridgeTweaked.php b/bridges/TwitterBridgeTweaked.php index 4f55fb9..5c1e53c 100644 --- a/bridges/TwitterBridgeTweaked.php +++ b/bridges/TwitterBridgeTweaked.php @@ -7,7 +7,7 @@ class TwitterBridgeTweaked extends BridgeAbstract{ $this->name = "Twitter Bridge Tweaked"; $this->uri = "https://twitter.com/"; $this->description = "(same as Twitter Bridge Extended, but with cleaned title & content)"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters["By keyword or hashtag"] = '[ @@ -147,14 +147,6 @@ class TwitterBridgeTweaked extends BridgeAbstract{ } } - public function getName(){ - return 'Twitter Bridge Tweaked'; - } - - public function getURI(){ - return 'http://twitter.com'; - } - public function getCacheDuration(){ return 300; // 5 minutes } diff --git a/bridges/UnsplashBridge.php b/bridges/UnsplashBridge.php index 6fa5c3c..ccbf2a2 100644 --- a/bridges/UnsplashBridge.php +++ b/bridges/UnsplashBridge.php @@ -71,14 +71,6 @@ class UnsplashBridge extends BridgeAbstract { } } - public function getName(){ - return 'Unsplash'; - } - - public function getURI(){ - return 'http://unsplash.com'; - } - public function getCacheDuration(){ return 43200; // 12 hours } diff --git a/bridges/ViadeoCompany.php b/bridges/ViadeoCompany.php index d5369a5..eee7a24 100644 --- a/bridges/ViadeoCompany.php +++ b/bridges/ViadeoCompany.php @@ -37,14 +37,6 @@ class ViadeoCompany extends BridgeAbstract{ } } - public function getName(){ - return 'Viadeo'; - } - - public function getURI(){ - return 'https://www.viadeo.com'; - } - public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/VineBridge.php b/bridges/VineBridge.php index daf520e..db63983 100644 --- a/bridges/VineBridge.php +++ b/bridges/VineBridge.php @@ -7,7 +7,7 @@ class VineBridge extends BridgeAbstract { $this->name = "Vine bridge"; $this->uri = "http://vine.co/"; $this->description = "Returns the latests vines from vine user page"; - $this->update = "2016-03-12"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -45,14 +45,6 @@ class VineBridge extends BridgeAbstract { } - public function getName(){ - return 'Vine'; - } - - public function getURI(){ - return 'http://vine.co'; - } - public function getCacheDuration(){ return 10; //seconds } diff --git a/bridges/WallpaperStopBridge.php b/bridges/WallpaperStopBridge.php index 2cd3d2d..7a70ef2 100644 --- a/bridges/WallpaperStopBridge.php +++ b/bridges/WallpaperStopBridge.php @@ -90,10 +90,6 @@ class WallpaperStopBridge extends BridgeAbstract { return 'WallpaperStop - '.$this->category.(!empty($this->subcategory) ? ' > '.$this->subcategory : '').' ['.$this->resolution.']'; } - public function getURI(){ - return 'http://www.wallpaperstop.com'; - } - public function getCacheDuration(){ return 43200; // 12 hours } diff --git a/bridges/WordPressBridge.php b/bridges/WordPressBridge.php index 69db325..28e5704 100644 --- a/bridges/WordPressBridge.php +++ b/bridges/WordPressBridge.php @@ -12,7 +12,7 @@ class WordPressBridge extends BridgeAbstract { $this->name = "Wordpress Bridge"; $this->uri = "https://wordpress.org/"; $this->description = "Returns the 3 newest full posts of a Wordpress blog"; - $this->update = "2016-08-06"; + $this->update = "2016-08-09"; $this->parameters[] = '[ @@ -136,10 +136,6 @@ class WordPressBridge extends BridgeAbstract { return "{$this->sitename} - Wordpress Bridge"; } - public function getURI() { - return $this->url; - } - public function getCacheDuration() { return 3600*3; // 3 hours } diff --git a/bridges/XbooruBridge.php b/bridges/XbooruBridge.php index 74fe4ab..2d28f44 100644 --- a/bridges/XbooruBridge.php +++ b/bridges/XbooruBridge.php @@ -49,14 +49,6 @@ class XbooruBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Xbooru'; - } - - public function getURI(){ - return 'http://xbooru.com/'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/YandereBridge.php b/bridges/YandereBridge.php index 088599f..65a6b1a 100644 --- a/bridges/YandereBridge.php +++ b/bridges/YandereBridge.php @@ -50,14 +50,6 @@ class YandereBridge extends BridgeAbstract{ } } - public function getName(){ - return 'Yande.re'; - } - - public function getURI(){ - return 'http://yande.re/post'; - } - public function getCacheDuration(){ return 1800; // 30 minutes } diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index bd6baae..08656bc 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -11,7 +11,7 @@ class YoutubeBridge extends BridgeAbstract { public function loadMetadatas() { $this->name = 'YouTube Bridge'; - $this->homepage = $this->getURI(); + $this->homepage = 'https://www.youtube.com/'; $this->description = 'Returns the 10 newest videos by username/channel/playlist or search'; $this->maintainer = 'mitsukarenai'; $this->update = '2016-08-09'; @@ -68,7 +68,7 @@ class YoutubeBridge extends BridgeAbstract { } private function ytBridgeQueryVideoInfo($vid, &$author, &$desc, &$time) { - $html = $this->file_get_html($this->getURI()."watch?v=$vid"); + $html = $this->file_get_html($this->uri."watch?v=$vid"); $author = $html->innertext; $author = substr($author, strpos($author, '"author=') + 8); $author = substr($author, 0, strpos($author, '\u0026')); @@ -82,8 +82,8 @@ class YoutubeBridge extends BridgeAbstract { $item->title = $title; $item->author = $author; $item->timestamp = $time; - $item->uri = $this->getURI().'watch?v='.$vid; - $thumbnailUri = str_replace('/www.', '/img.', $this->getURI()).'vi/'.$vid.'/0.jpg'; + $item->uri = $this->uri.'watch?v='.$vid; + $thumbnailUri = str_replace('/www.', '/img.', $this->uri).'vi/'.$vid.'/0.jpg'; $item->content = '

'.$desc; $this->items[] = $item; } @@ -130,12 +130,12 @@ class YoutubeBridge extends BridgeAbstract { if (isset($param['u'])) { /* User and Channel modes */ $this->request = $param['u']; - $url_feed = $this->getURI().'feeds/videos.xml?user='.urlencode($this->request); - $url_listing = $this->getURI().'user/'.urlencode($this->request).'/videos'; + $url_feed = $this->uri.'feeds/videos.xml?user='.urlencode($this->request); + $url_listing = $this->uri.'user/'.urlencode($this->request).'/videos'; } else if (isset($param['c'])) { $this->request = $param['c']; - $url_feed = $this->getURI().'feeds/videos.xml?channel_id='.urlencode($this->request); - $url_listing = $this->getURI().'channel/'.urlencode($this->request).'/videos'; + $url_feed = $this->uri.'feeds/videos.xml?channel_id='.urlencode($this->request); + $url_listing = $this->uri.'channel/'.urlencode($this->request).'/videos'; } if (!empty($url_feed) && !empty($url_listing)) { if ($xml = $this->file_get_html($url_feed)) { @@ -147,7 +147,7 @@ class YoutubeBridge extends BridgeAbstract { else if (isset($param['p'])) { /* playlist mode */ $this->request = $param['p']; - $url_listing = $this->getURI().'playlist?list='.urlencode($this->request); + $url_listing = $this->uri.'playlist?list='.urlencode($this->request); $html = $this->file_get_html($url_listing) or $this->returnError("Could not request YouTube. Tried:\n - $url_listing", 500); $this->ytBridgeParseHtmlListing($html, 'tr.pl-video', '.pl-video-title a'); $this->request = 'Playlist: '.str_replace(' - YouTube', '', $html->find('title', 0)->plaintext); @@ -155,7 +155,7 @@ class YoutubeBridge extends BridgeAbstract { else if (isset($param['s'])) { /* search mode */ $this->request = $param['s']; $page = 1; if (isset($param['pa'])) $page = (int)preg_replace("/[^0-9]/",'', $param['pa']); - $url_listing = $this->getURI().'results?search_query='.urlencode($this->request).'&page='.$page.'&filters=video&search_sort=video_date_uploaded'; + $url_listing = $this->uri.'results?search_query='.urlencode($this->request).'&page='.$page.'&filters=video&search_sort=video_date_uploaded'; $html = $this->file_get_html($url_listing) or $this->returnError("Could not request YouTube. Tried:\n - $url_listing", 500); $this->ytBridgeParseHtmlListing($html, 'div.yt-lockup', 'h3'); $this->request = 'Search: '.str_replace(' - YouTube', '', $html->find('title', 0)->plaintext); @@ -170,10 +170,6 @@ class YoutubeBridge extends BridgeAbstract { return (!empty($this->request) ? $this->request .' - ' : '') .'YouTube Bridge'; } - public function getURI(){ - return 'https://www.youtube.com/'; - } - public function getCacheDuration(){ return 10800; // 3 hours } diff --git a/bridges/ZatazBridge.php b/bridges/ZatazBridge.php index baf2828..7a771da 100644 --- a/bridges/ZatazBridge.php +++ b/bridges/ZatazBridge.php @@ -4,15 +4,15 @@ class ZatazBridge extends BridgeAbstract { public function loadMetadatas() { $this->maintainer = "aledeg"; - $this->name = "Zataz"; - $this->uri = "http://www.zataz.com/"; + $this->name = 'Zataz Magazine'; + $this->uri = 'http://www.zataz.com'; $this->description = "ZATAZ Magazine - S'informer, c'est déjà se sécuriser"; - $this->update = "07/02/2015"; + $this->update = "2016-08-09"; } public function collectData(array $param) { - $html = $this->file_get_html($this->getURI()) or $this->returnError('Could not request ' . $this->getURI(), 404); + $html = $this->file_get_html($this->uri) or $this->returnError('Could not request ' . $this->uri, 404); $recent_posts = $html->find('#recent-posts-3', 0)->find('ul', 0)->find('li'); foreach ($recent_posts as $article) { @@ -42,16 +42,8 @@ class ZatazBridge extends BridgeAbstract { return $date->format('U'); } - public function getName() { - return 'Zataz Magazine'; - } - public function getCacheDuration() { return 7200; // 2h } - public function getURI() { - return 'http://www.zataz.com'; - } - } From 1a572f66395cd8bfb4639264770fbe281176b329 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Tue, 9 Aug 2016 21:36:45 +0200 Subject: [PATCH 02/12] [TwitterBridgeExtended] Use username as alternative to the image --- bridges/TwitterBridgeExtended.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index b824a72..6a90c2e 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -70,7 +70,7 @@ class TwitterBridgeExtended extends BridgeAbstract{ } // get tweet text - $item->content = 'avatar'.$item->username.' '.$item->fullname.'

'.str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext).'
'; + $item->content = ''.$item->username.' '.$item->fullname.'
'.str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext).'
'; // generate the title $item->title = $item->fullname . ' (@'. $item->username . ') | ' . $item->content_simple; // put out From 13d9b8d462a35d2cdff4f906fff4977f7f4fe1a1 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Tue, 9 Aug 2016 21:47:29 +0200 Subject: [PATCH 03/12] [TwitterBridgeExtended] Use heredoc syntax to build ->content --- bridges/TwitterBridgeExtended.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index 6a90c2e..e0e2607 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -70,7 +70,16 @@ class TwitterBridgeExtended extends BridgeAbstract{ } // get tweet text - $item->content = ''.$item->username.' '.$item->fullname.'
'.str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext).'
'; + //$item->content = ''.$item->username.'

'.$item->fullname.'


'.str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext).'
'; + + $cleanedTweet = str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext); + + $item->content = <<{$item->username} +

{$item->fullname}


+
{$cleanedTweet}
+EOD; + // generate the title $item->title = $item->fullname . ' (@'. $item->username . ') | ' . $item->content_simple; // put out From 0683457eb3288e1f322fb4f2543e2e6daefb30ca Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Tue, 9 Aug 2016 21:59:55 +0200 Subject: [PATCH 04/12] [TwitterBridgeExtended] Reduce size of emojis in the tweet --- bridges/TwitterBridgeExtended.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index e0e2607..df1e492 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -69,9 +69,12 @@ class TwitterBridgeExtended extends BridgeAbstract{ $link->removeAttribute('title'); } - // get tweet text - //$item->content = ''.$item->username.'

'.$item->fullname.'


'.str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext).'
'; + // process emojis (reduce size) + foreach($tweet->find('img.Emoji') as $img){ + $img->style .= ' height: 1em;'; + } + // get tweet text $cleanedTweet = str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext); $item->content = << Date: Tue, 9 Aug 2016 22:05:42 +0200 Subject: [PATCH 05/12] [TwitterBridgeExtended] Use inline-blocks to format HTML output --- bridges/TwitterBridgeExtended.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index df1e492..acbe6f1 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -78,9 +78,12 @@ class TwitterBridgeExtended extends BridgeAbstract{ $cleanedTweet = str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext); $item->content = <<{$item->username} -

{$item->fullname}


-
{$cleanedTweet}
+
+ {$item->username} +
+
+
{$cleanedTweet}
+
EOD; // generate the title From 61380317933bc7dba1e07957f68bad4c6a7cc1fa Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 10 Aug 2016 10:08:03 +0200 Subject: [PATCH 06/12] [TwitterBridgeExtended] Add border around profile picture --- bridges/TwitterBridgeExtended.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index acbe6f1..ba98b63 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -79,7 +79,7 @@ class TwitterBridgeExtended extends BridgeAbstract{ $item->content = << - {$item->username} + {$item->username}
{$cleanedTweet}
From 89aad9f79628ae31d78bcc11040f227c4a673a2a Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 10 Aug 2016 10:26:29 +0200 Subject: [PATCH 07/12] [TwitterBridgeExtended] Directly write content to ->title --- bridges/TwitterBridgeExtended.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index ba98b63..0fdebb4 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -45,6 +45,8 @@ class TwitterBridgeExtended extends BridgeAbstract{ $item->username = $tweet->getAttribute('data-screen-name'); // extract fullname (pseudonym) $item->fullname = $tweet->getAttribute('data-name'); + // get author + $item->author = $item->fullname . ' (@' . $item->username . ')'; // get avatar link $item->avatar = $tweet->find('img', 0)->src; // get TweetID @@ -53,8 +55,8 @@ class TwitterBridgeExtended extends BridgeAbstract{ $item->uri = 'https://twitter.com'.$tweet->find('a.js-permalink', 0)->getAttribute('href'); // extract tweet timestamp $item->timestamp = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time'); - // extract plaintext - $item->content_simple = str_replace('href="/', 'href="https://twitter.com/', html_entity_decode(strip_tags($tweet->find('p.js-tweet-text', 0)->innertext, ''))); + // generate the title + $item->title = strip_tags($tweet->find('p.js-tweet-text', 0)->innertext); // processing content links foreach($tweet->find('a') as $link) { @@ -86,8 +88,6 @@ class TwitterBridgeExtended extends BridgeAbstract{
EOD; - // generate the title - $item->title = $item->fullname . ' (@'. $item->username . ') | ' . $item->content_simple; // put out $this->items[] = $item; } From a628abd04c8c603619cbdac54d330117347f0e78 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 10 Aug 2016 10:44:23 +0200 Subject: [PATCH 08/12] [TwitterBridgeExtended] Add option to show/hide profile pictures --- bridges/TwitterBridgeExtended.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index 0fdebb4..8a6d079 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -7,7 +7,19 @@ class TwitterBridgeExtended extends BridgeAbstract{ $this->name = "Twitter Bridge Extended"; $this->uri = "https://twitter.com/"; $this->description = "(same as Twitter Bridge, but with avatar, replies and RTs)"; - $this->update = "2016-08-09"; + $this->update = "2016-08-10"; + + $this->parameters["global"] = + '[ + { + "name" : "Hide profile pictures", + "identifier" : "pic", + "type" : "checkbox", + "required" : "false", + "exampleValue" : "checked", + "title" : "Activate to hide profile pictures in content" + } + ]'; $this->parameters["By keyword or hashtag"] = '[ @@ -39,6 +51,10 @@ class TwitterBridgeExtended extends BridgeAbstract{ $this->returnError('You must specify a keyword (?q=...) or a Twitter username (?u=...).', 400); } + $hidePictures = false; + if (isset($param['pic'])) + $hidePictures = $param['pic'] === 'on'; + foreach($html->find('div.js-stream-tweet') as $tweet) { $item = new \Item(); // extract username and sanitize @@ -79,9 +95,18 @@ class TwitterBridgeExtended extends BridgeAbstract{ // get tweet text $cleanedTweet = str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext); + // Add picture to content + $picture_html = ''; + if(!$hidePictures){ + $picture_html = <<{$item->username} +EOD; + } + + // add content $item->content = << - {$item->username} + {$picture_html}
{$cleanedTweet}
From 5ef26343b3700e0c68881cd93e219a4a0b6969fc Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 10 Aug 2016 10:55:06 +0200 Subject: [PATCH 09/12] [TwitterBridgeExtended] Complete definition of parameters --- bridges/TwitterBridgeExtended.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridgeExtended.php index 8a6d079..21f05ff 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridgeExtended.php @@ -25,7 +25,11 @@ class TwitterBridgeExtended extends BridgeAbstract{ '[ { "name" : "Keyword or #hashtag", - "identifier" : "q" + "identifier" : "q", + "type" : "text", + "required" : "true", + "exampleValue" : "rss-bridge, #rss-bridge", + "title" : "Insert a keyword or hashtag" } ]'; @@ -33,7 +37,11 @@ class TwitterBridgeExtended extends BridgeAbstract{ '[ { "name" : "username", - "identifier" : "u" + "identifier" : "u", + "type" : "text", + "required" : "true", + "exampleValue" : "sebsauvage", + "title" : "Insert a user name" } ]'; From 1ea38d521d8475396a861fffc173080360f7896a Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 10 Aug 2016 10:56:06 +0200 Subject: [PATCH 10/12] bridges: Remove all Twitter bridges except TwitterBridgeExtended --- bridges/TwitterBridge.php | 80 ------------- bridges/TwitterBridgeClean.php | 81 ------------- bridges/TwitterBridgeCleanExtended.php | 86 -------------- bridges/TwitterBridgeTweaked.php | 153 ------------------------- 4 files changed, 400 deletions(-) delete mode 100644 bridges/TwitterBridge.php delete mode 100644 bridges/TwitterBridgeClean.php delete mode 100644 bridges/TwitterBridgeCleanExtended.php delete mode 100644 bridges/TwitterBridgeTweaked.php diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php deleted file mode 100644 index 4a7ec9d..0000000 --- a/bridges/TwitterBridge.php +++ /dev/null @@ -1,80 +0,0 @@ -maintainer = "mitsukarenai"; - $this->name = "Twitter Bridge"; - $this->uri = "http://twitter.com/"; - $this->description = "Returns user timelines or keyword/hashtag search results (without using their API)."; - $this->update = "2016-08-09"; - - $this->parameters["By keyword or hashtag"] = - '[ - { - "name" : "Keyword or #hashtag", - "identifier" : "q" - } - ]'; - - $this->parameters["By username"] = - '[ - { - "name" : "username", - "identifier" : "u" - } - ]'; - - } - - public function collectData(array $param){ - $html = ''; - if (isset($param['q'])) { /* keyword search mode */ - $this->request = $param['q']; - $html = $this->file_get_html('https://twitter.com/search?q='.urlencode($this->request).'&f=tweets') or $this->returnError('No results for this query.', 404); - } - elseif (isset($param['u'])) { /* user timeline mode */ - $this->request = $param['u']; - $html = $this->file_get_html('http://twitter.com/'.urlencode($this->request)) or $this->returnError('Requested username can\'t be found.', 404); - } - else { - $this->returnError('You must specify a keyword (?q=...) or a Twitter username (?u=...).', 400); - } - - foreach($html->find('div.js-stream-tweet') as $tweet) { - $item = new \Item(); - $item->username = $tweet->getAttribute('data-screen-name'); // extract username and sanitize - $item->fullname = $tweet->getAttribute('data-name'); // extract fullname (pseudonym) - $item->avatar = $tweet->find('img', 0)->src; // get avatar link - $item->id = $tweet->getAttribute('data-tweet-id'); // get TweetID - $item->uri = 'https://twitter.com'.$tweet->find('a.js-permalink', 0)->getAttribute('href'); // get tweet link - $item->timestamp = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time'); // extract tweet timestamp - // processing content links - foreach($tweet->find('a') as $link) { - if($link->hasAttribute('data-expanded-url') ) { - $link->href = $link->getAttribute('data-expanded-url'); - } - $link->removeAttribute('data-expanded-url'); - $link->removeAttribute('data-query-source'); - $link->removeAttribute('rel'); - $link->removeAttribute('class'); - $link->removeAttribute('target'); - $link->removeAttribute('title'); - } - $item->content = str_replace('href="/', 'href="https://twitter.com/', strip_tags($tweet->find('p.js-tweet-text', 0)->innertext, '')); // extract tweet text - $item->title = $item->fullname . ' (@' . $item->username . ') | ' . html_entity_decode(strip_tags($item->content),ENT_QUOTES,'UTF-8'); - $this->items[] = $item; - } - } - - public function getName(){ - return (!empty($this->request) ? $this->request .' - ' : '') .'Twitter Bridge'; - } - - public function getCacheDuration(){ - return 300; // 5 minutes - } -} diff --git a/bridges/TwitterBridgeClean.php b/bridges/TwitterBridgeClean.php deleted file mode 100644 index 235469c..0000000 --- a/bridges/TwitterBridgeClean.php +++ /dev/null @@ -1,81 +0,0 @@ -maintainer = "vinzv"; - $this->name = "Twitter Bridge Clean"; - $this->uri = "http://twitter.com/"; - $this->description = "Returns user timelines without username in title or search results for keywords/hashtags (without using their API)."; - $this->update = "2016-08-09"; - - $this->parameters["By keyword or hashtag"] = - '[ - { - "name" : "Keyword or #hashtag", - "identifier" : "q" - } - ]'; - - $this->parameters["By username"] = - '[ - { - "name" : "username", - "identifier" : "u" - } - ]'; - - } - - public function collectData(array $param){ - $html = ''; - if (isset($param['q'])) { /* keyword search mode */ - $this->request = $param['q']; - $html = $this->file_get_html('https://twitter.com/search?q='.urlencode($this->request).'&f=tweets') or $this->returnError('No results for this query.', 404); - } - elseif (isset($param['u'])) { /* user timeline mode */ - $this->request = $param['u']; - $html = $this->file_get_html('http://twitter.com/'.urlencode($this->request)) or $this->returnError('Requested username can\'t be found.', 404); - } - else { - $this->returnError('You must specify a keyword (?q=...) or a Twitter username (?u=...).', 400); - } - - foreach($html->find('div.js-stream-tweet') as $tweet) { - $item = new \Item(); - $item->username = $tweet->getAttribute('data-screen-name'); // extract username and sanitize - $item->fullname = $tweet->getAttribute('data-name'); // extract fullname (pseudonym) - $item->avatar = $tweet->find('img', 0)->src; // get avatar link - $item->id = $tweet->getAttribute('data-tweet-id'); // get TweetID - $item->uri = 'https://twitter.com'.$tweet->find('a.js-permalink', 0)->getAttribute('href'); // get tweet link - $item->timestamp = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time'); // extract tweet timestamp - // processing content links - foreach($tweet->find('a') as $link) { - if($link->hasAttribute('data-expanded-url') ) { - $link->href = $link->getAttribute('data-expanded-url'); - } - $link->removeAttribute('data-expanded-url'); - $link->removeAttribute('data-query-source'); - $link->removeAttribute('rel'); - $link->removeAttribute('class'); - $link->removeAttribute('target'); - $link->removeAttribute('title'); - $link->removeAttribute('dir'); - } - $item->content = str_replace('pic.twitter.com', 'https://pic.twitter.com', strip_tags($tweet->find('p.js-tweet-text', 0)->innertext)); // extract tweet text - $item->title = html_entity_decode($item->content,ENT_QUOTES,'UTF-8'); - $this->items[] = $item; - } - } - - public function getName(){ - return (!empty($this->request) ? $this->request .' - ' : '') .'Twitter Bridge'; - } - - public function getCacheDuration(){ - return 300; // 5 minutes - } -} diff --git a/bridges/TwitterBridgeCleanExtended.php b/bridges/TwitterBridgeCleanExtended.php deleted file mode 100644 index 1be4c7b..0000000 --- a/bridges/TwitterBridgeCleanExtended.php +++ /dev/null @@ -1,86 +0,0 @@ -maintainer = "Max Mehl"; - $this->name = "Twitter Bridge Clean Extended"; - $this->uri = "http://twitter.com/"; - $this->description = "Returns user timelines showing RTs correctly or search results for keywords/hashtags (without using their API)."; - $this->update = "2016-08-09"; - - $this->parameters["By keyword or hashtag"] = - '[ - { - "name" : "Keyword or #hashtag", - "identifier" : "q" - } - ]'; - - $this->parameters["By username"] = - '[ - { - "name" : "username", - "identifier" : "u" - } - ]'; - - } - - public function collectData(array $param){ - $html = ''; - if (isset($param['q'])) { /* keyword search mode */ - $this->request = $param['q']; - $html = $this->file_get_html('https://twitter.com/search?q='.urlencode($this->request).'&f=tweets') or $this->returnError('No results for this query.', 404); - } - elseif (isset($param['u'])) { /* user timeline mode */ - $this->request = $param['u']; - $html = $this->file_get_html('http://twitter.com/'.urlencode($this->request)) or $this->returnError('Requested username can\'t be found.', 404); - } - else { - $this->returnError('You must specify a keyword (?q=...) or a Twitter username (?u=...).', 400); - } - - foreach($html->find('div.js-stream-tweet') as $tweet) { - $item = new \Item(); - $item->username = $tweet->getAttribute('data-screen-name'); // extract username and sanitize - $item->fullname = $tweet->getAttribute('data-name'); // extract fullname (pseudonym) - $item->avatar = $tweet->find('img', 0)->src; // get avatar link - $item->id = $tweet->getAttribute('data-tweet-id'); // get TweetID - $item->uri = 'https://twitter.com'.$tweet->find('a.js-permalink', 0)->getAttribute('href'); // get tweet link - $item->timestamp = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time'); // extract tweet timestamp - // processing content links - foreach($tweet->find('a') as $link) { - if($link->hasAttribute('data-expanded-url') ) { - $link->href = $link->getAttribute('data-expanded-url'); - } - $link->removeAttribute('data-expanded-url'); - $link->removeAttribute('data-query-source'); - $link->removeAttribute('rel'); - $link->removeAttribute('class'); - $link->removeAttribute('target'); - $link->removeAttribute('title'); - $link->removeAttribute('dir'); - } - $item->content = str_replace('pic.twitter.com', 'https://pic.twitter.com', strip_tags($tweet->find('p.js-tweet-text', 0)->innertext)); // extract tweet text - if(isset($param['u'])) { - if($item->username != $param['u']) { - $item->content = '♻ @' . $item->username . ': ' . $item->content; - } - } - $item->title = html_entity_decode($item->content,ENT_QUOTES,'UTF-8'); - $this->items[] = $item; - } - } - - public function getName(){ - return (!empty($this->request) ? $this->request : ''); - } - - public function getCacheDuration(){ - return 300; // 5 minutes - } -} diff --git a/bridges/TwitterBridgeTweaked.php b/bridges/TwitterBridgeTweaked.php deleted file mode 100644 index 5c1e53c..0000000 --- a/bridges/TwitterBridgeTweaked.php +++ /dev/null @@ -1,153 +0,0 @@ -maintainer = "kraoc"; - $this->name = "Twitter Bridge Tweaked"; - $this->uri = "https://twitter.com/"; - $this->description = "(same as Twitter Bridge Extended, but with cleaned title & content)"; - $this->update = "2016-08-09"; - - $this->parameters["By keyword or hashtag"] = - '[ - { - "name" : "Keyword or #hashtag", - "identifier" : "q" - } - ]'; - - $this->parameters["By username"] = - '[ - { - "name" : "username", - "identifier" : "u" - } - ]'; - - } - - private function containsTLD($string) { - preg_match( - "/(AC($|\/)|\.AD($|\/)|\.AE($|\/)|\.AERO($|\/)|\.AF($|\/)|\.AG($|\/)|\.AI($|\/)|\.AL($|\/)|\.AM($|\/)|\.AN($|\/)|\.AO($|\/)|\.AQ($|\/)|\.AR($|\/)|\.ARPA($|\/)|\.AS($|\/)|\.ASIA($|\/)|\.AT($|\/)|\.AU($|\/)|\.AW($|\/)|\.AX($|\/)|\.AZ($|\/)|\.BA($|\/)|\.BB($|\/)|\.BD($|\/)|\.BE($|\/)|\.BF($|\/)|\.BG($|\/)|\.BH($|\/)|\.BI($|\/)|\.BIZ($|\/)|\.BJ($|\/)|\.BM($|\/)|\.BN($|\/)|\.BO($|\/)|\.BR($|\/)|\.BS($|\/)|\.BT($|\/)|\.BV($|\/)|\.BW($|\/)|\.BY($|\/)|\.BZ($|\/)|\.CA($|\/)|\.CAT($|\/)|\.CC($|\/)|\.CD($|\/)|\.CF($|\/)|\.CG($|\/)|\.CH($|\/)|\.CI($|\/)|\.CK($|\/)|\.CL($|\/)|\.CM($|\/)|\.CN($|\/)|\.CO($|\/)|\.COM($|\/)|\.COOP($|\/)|\.CR($|\/)|\.CU($|\/)|\.CV($|\/)|\.CX($|\/)|\.CY($|\/)|\.CZ($|\/)|\.DE($|\/)|\.DJ($|\/)|\.DK($|\/)|\.DM($|\/)|\.DO($|\/)|\.DZ($|\/)|\.EC($|\/)|\.EDU($|\/)|\.EE($|\/)|\.EG($|\/)|\.ER($|\/)|\.ES($|\/)|\.ET($|\/)|\.EU($|\/)|\.FI($|\/)|\.FJ($|\/)|\.FK($|\/)|\.FM($|\/)|\.FO($|\/)|\.FR($|\/)|\.GA($|\/)|\.GB($|\/)|\.GD($|\/)|\.GE($|\/)|\.GF($|\/)|\.GG($|\/)|\.GH($|\/)|\.GI($|\/)|\.GL($|\/)|\.GM($|\/)|\.GN($|\/)|\.GOV($|\/)|\.GP($|\/)|\.GQ($|\/)|\.GR($|\/)|\.GS($|\/)|\.GT($|\/)|\.GU($|\/)|\.GW($|\/)|\.GY($|\/)|\.HK($|\/)|\.HM($|\/)|\.HN($|\/)|\.HR($|\/)|\.HT($|\/)|\.HU($|\/)|\.ID($|\/)|\.IE($|\/)|\.IL($|\/)|\.IM($|\/)|\.IN($|\/)|\.INFO($|\/)|\.INT($|\/)|\.IO($|\/)|\.IQ($|\/)|\.IR($|\/)|\.IS($|\/)|\.IT($|\/)|\.JE($|\/)|\.JM($|\/)|\.JO($|\/)|\.JOBS($|\/)|\.JP($|\/)|\.KE($|\/)|\.KG($|\/)|\.KH($|\/)|\.KI($|\/)|\.KM($|\/)|\.KN($|\/)|\.KP($|\/)|\.KR($|\/)|\.KW($|\/)|\.KY($|\/)|\.KZ($|\/)|\.LA($|\/)|\.LB($|\/)|\.LC($|\/)|\.LI($|\/)|\.LK($|\/)|\.LR($|\/)|\.LS($|\/)|\.LT($|\/)|\.LU($|\/)|\.LV($|\/)|\.LY($|\/)|\.MA($|\/)|\.MC($|\/)|\.MD($|\/)|\.ME($|\/)|\.MG($|\/)|\.MH($|\/)|\.MIL($|\/)|\.MK($|\/)|\.ML($|\/)|\.MM($|\/)|\.MN($|\/)|\.MO($|\/)|\.MOBI($|\/)|\.MP($|\/)|\.MQ($|\/)|\.MR($|\/)|\.MS($|\/)|\.MT($|\/)|\.MU($|\/)|\.MUSEUM($|\/)|\.MV($|\/)|\.MW($|\/)|\.MX($|\/)|\.MY($|\/)|\.MZ($|\/)|\.NA($|\/)|\.NAME($|\/)|\.NC($|\/)|\.NE($|\/)|\.NET($|\/)|\.NF($|\/)|\.NG($|\/)|\.NI($|\/)|\.NL($|\/)|\.NO($|\/)|\.NP($|\/)|\.NR($|\/)|\.NU($|\/)|\.NZ($|\/)|\.OM($|\/)|\.ORG($|\/)|\.PA($|\/)|\.PE($|\/)|\.PF($|\/)|\.PG($|\/)|\.PH($|\/)|\.PK($|\/)|\.PL($|\/)|\.PM($|\/)|\.PN($|\/)|\.PR($|\/)|\.PRO($|\/)|\.PS($|\/)|\.PT($|\/)|\.PW($|\/)|\.PY($|\/)|\.QA($|\/)|\.RE($|\/)|\.RO($|\/)|\.RS($|\/)|\.RU($|\/)|\.RW($|\/)|\.SA($|\/)|\.SB($|\/)|\.SC($|\/)|\.SD($|\/)|\.SE($|\/)|\.SG($|\/)|\.SH($|\/)|\.SI($|\/)|\.SJ($|\/)|\.SK($|\/)|\.SL($|\/)|\.SM($|\/)|\.SN($|\/)|\.SO($|\/)|\.SR($|\/)|\.ST($|\/)|\.SU($|\/)|\.SV($|\/)|\.SY($|\/)|\.SZ($|\/)|\.TC($|\/)|\.TD($|\/)|\.TEL($|\/)|\.TF($|\/)|\.TG($|\/)|\.TH($|\/)|\.TJ($|\/)|\.TK($|\/)|\.TL($|\/)|\.TM($|\/)|\.TN($|\/)|\.TO($|\/)|\.TP($|\/)|\.TR($|\/)|\.TRAVEL($|\/)|\.TT($|\/)|\.TV($|\/)|\.TW($|\/)|\.TZ($|\/)|\.UA($|\/)|\.UG($|\/)|\.UK($|\/)|\.US($|\/)|\.UY($|\/)|\.UZ($|\/)|\.VA($|\/)|\.VC($|\/)|\.VE($|\/)|\.VG($|\/)|\.VI($|\/)|\.VN($|\/)|\.VU($|\/)|\.WF($|\/)|\.WS($|\/)|\.XN--0ZWM56D($|\/)|\.XN--11B5BS3A9AJ6G($|\/)|\.XN--80AKHBYKNJ4F($|\/)|\.XN--9T4B11YI5A($|\/)|\.XN--DEBA0AD($|\/)|\.XN--G6W251D($|\/)|\.XN--HGBK6AJ7F53BBA($|\/)|\.XN--HLCJ6AYA9ESC7A($|\/)|\.XN--JXALPDLP($|\/)|\.XN--KGBECHTV($|\/)|\.XN--ZCKZAH($|\/)|\.YE($|\/)|\.YT($|\/)|\.YU($|\/)|\.ZA($|\/)|\.ZM($|\/)|\.ZW)/i", - $string, - $M - ); - $has_tld = (count($M) > 0) ? true : false; - return $has_tld; - } - private function cleaner($url) { - $U = explode(' ', $url); - $W =array(); - foreach ($U as $k => $u) { - if (stristr($u,".")) { //only preg_match if there is a dot - if ($this->containsTLD($u) === true) { - unset($U[$k]); - return $this->cleaner( implode(' ', $U) ); - } - } - } - return implode(' ', $U); - } - - // (c) Kraoc / urlclean - // https://github.com/kraoc/Leed-market/blob/master/urlclean/urlclean.plugin.disabled.php - private function resolve_url($link) { - // fallback to crawl to real url (slowest method and unsecure to privacy) - if (function_exists('curl_init') && !ini_get('safe_mode')) { - curl_setopt($ch, CURLOPT_USERAGENT, $ua); - curl_setopt($ch, CURLOPT_URL, $link); - curl_setopt($ch, CURLOPT_HEADER, true); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - // >>> anonimization - curl_setopt($ch, CURLOPT_COOKIESESSION, true); - curl_setopt($ch, CURLOPT_REFERER, ''); - // <<< anonimization - $ch = curl_init(); - $ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.16 (KHTML, like Gecko) Chrome/24.0.1304.0 Safari/537.16'; - $a = curl_exec($ch); - $link = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); - } - - $link = preg_replace("/[&#?]xtor=(.)+/", "", $link); // remove: xtor - $link = preg_replace("/utm_([^&#]|(&))+&*/", "", $link); // remove: utm_ - - // cleanup end of url - $link = preg_replace("/\?&/", "", $link); - if (isset($link[strlen($link) -1])){ - if ($link[strlen($link) -1] == '?') - $link = substr($link, 0, strlen($link) -1); - } - - return $link; - } - - public function collectData(array $param){ - $html = ''; - if (isset($param['q'])) { /* keyword search mode */ - $html = $this->file_get_html('https://twitter.com/search?q='.urlencode($param['q']).'&f=tweets') or $this->returnError('No results for this query.', 404); - } - elseif (isset($param['u'])) { /* user timeline mode */ - $html = $this->file_get_html('https://twitter.com/'.urlencode($param['u']).'/with_replies') or $this->returnError('Requested username can\'t be found.', 404); - } - else { - $this->returnError('You must specify a keyword (?q=...) or a Twitter username (?u=...).', 400); - } - - foreach($html->find('div.js-stream-tweet') as $tweet) { - $item = new \Item(); - // extract username and sanitize - $item->username = $tweet->getAttribute('data-screen-name'); - // extract fullname (pseudonym) - $item->fullname = $tweet->getAttribute('data-name'); - // get avatar link - $item->avatar = $tweet->find('img', 0)->src; - // get TweetID - $item->id = $tweet->getAttribute('data-tweet-id'); - // get tweet link - $item->uri = 'https://twitter.com'.$tweet->find('a.js-permalink', 0)->getAttribute('href'); - // extract tweet timestamp - $item->timestamp = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time'); - // extract plaintext - $item->content_simple = str_replace('href="/', 'href="https://twitter.com/', html_entity_decode(strip_tags($tweet->find('p.js-tweet-text', 0)->innertext, ''))); - - // processing content links - foreach($tweet->find('a') as $link) { - if($link->hasAttribute('data-expanded-url') ) { - $link->href = $link->getAttribute('data-expanded-url'); - } - $link->removeAttribute('data-expanded-url'); - $link->removeAttribute('data-query-source'); - $link->removeAttribute('rel'); - $link->removeAttribute('class'); - $link->removeAttribute('target'); - $link->removeAttribute('title'); - } - - // get tweet text - $item->content = 'avatar'.$item->username.' '.$item->fullname.'
'.str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext).'
'; - // generate the title -// $item->title = $item->fullname . ' (@'. $item->username . ') | ' . $item->content_simple; - $item->title = $item->content_simple; - $item->title = preg_replace('|https?://www\.[a-z\.0-9]+|i', '', $item->title); // remove http(s) links - $item->title = preg_replace('|www\.[a-z\.0-9]+|i', '', $item->title); // remove www. links - $item->title = $this->cleaner($item->title); // remove all remaining links - $item->title = trim($item->title); // remove extra spaces at beginning and end - - // convert all content links to real ones - $regex = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; - $item->content = preg_replace_callback($regex, function($url) { - // do stuff with $url[0] here - return $this->resolve_url($url[0]); - }, $item->content); - - // put out - $this->items[] = $item; - } - } - - public function getCacheDuration(){ - return 300; // 5 minutes - } -} From 68d1c1f961585e6852cfa1bbd99d4db0dc45f9c0 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 10 Aug 2016 11:00:40 +0200 Subject: [PATCH 11/12] [TwitterBridgeExtended] -> [TwitterBridge] make this the only one --- bridges/{TwitterBridgeExtended.php => TwitterBridge.php} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename bridges/{TwitterBridgeExtended.php => TwitterBridge.php} (95%) diff --git a/bridges/TwitterBridgeExtended.php b/bridges/TwitterBridge.php similarity index 95% rename from bridges/TwitterBridgeExtended.php rename to bridges/TwitterBridge.php index 21f05ff..04b0d0e 100644 --- a/bridges/TwitterBridgeExtended.php +++ b/bridges/TwitterBridge.php @@ -1,12 +1,12 @@ maintainer = "mitsukarenai"; - $this->name = "Twitter Bridge Extended"; + $this->name = "Twitter Bridge"; $this->uri = "https://twitter.com/"; - $this->description = "(same as Twitter Bridge, but with avatar, replies and RTs)"; + $this->description = "Returns tweets by keyword/hashtag or user name"; $this->update = "2016-08-10"; $this->parameters["global"] = From 0c1ec44c497060e58d6e2ff842909f9103ce46ae Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 10 Aug 2016 11:41:35 +0200 Subject: [PATCH 12/12] bridges: Merge all Allocine* bridges into AllocineFRBridge --- bridges/AllocineFRBridge.php | 98 +++++++++++++++++-------- bridges/AllocineT5Bridge.php | 54 -------------- bridges/AllocineTueursEnSerieBridge.php | 54 -------------- 3 files changed, 69 insertions(+), 137 deletions(-) delete mode 100644 bridges/AllocineT5Bridge.php delete mode 100644 bridges/AllocineTueursEnSerieBridge.php diff --git a/bridges/AllocineFRBridge.php b/bridges/AllocineFRBridge.php index c54edff..b0a5b4c 100644 --- a/bridges/AllocineFRBridge.php +++ b/bridges/AllocineFRBridge.php @@ -1,54 +1,94 @@ maintainer = "superbaillot.net"; - $this->name = "Allo Cine : Faux Raccord"; - $this->uri = "http://www.allocine.fr/video/programme-12284/saison-24580/"; - $this->description = "Allo Cine : Faux Raccord"; - $this->update = "2016-08-06"; + $this->maintainer = "superbaillot.net"; + $this->name = "Allo Cine Bridge"; + $this->uri = "http://www.allocine.fr"; + $this->description = "Bridge for allocine.fr"; + $this->update = "2016-08-10"; - } + $this->parameters[] = + '[ + { + "name" : "category", + "identifier" : "category", + "type" : "list", + "required" : "true", + "exampleValue" : "Faux Raccord", + "title" : "Select your category", + "values" : + [ + { + "name" : "Faux Raccord", + "value" : "faux-raccord" + }, + { + "name" : "Top 5", + "value" : "top-5" + }, + { + "name" : "Tueurs En Serie", + "value" : "tuers-en-serie" + } + ] + } + ]'; + } - public function collectData(array $param){ - $html = $this->file_get_html($this->_URL) or $this->returnError('Could not request Allo cine.', 404); + public function collectData(array $params){ + + // Check all parameters + if(!isset($params['category'])) + $this->returnError('You must specify a valid category (&category= )!', 400); + + $category = ''; + switch($params['category']){ + case 'faux-raccord': + $this->uri = 'http://www.allocine.fr/video/programme-12284/saison-24580/'; + $category = 'Faux Raccord'; + break; + case 'top-5': + $this->uri = 'http://www.allocine.fr/video/programme-12299/saison-22542/'; + $category = 'Top 5'; + break; + case 'tuers-en-serie': + $this->uri = 'http://www.allocine.fr/video/programme-12286/saison-22938/'; + $category = 'Tueurs en Séries'; + break; + default: + $this->returnError('You must select a valid category!', 400); + } + + // Update bridge name to match selection + $this->name .= ' : ' . $category; + + $html = $this->file_get_html($this->uri) or $this->returnError("Could not request {$this->uri}!", 404); foreach($html->find('figure.media-meta-fig') as $element) { $item = new Item(); - $titre = $element->find('div.titlebar h3.title a', 0); + $title = $element->find('div.titlebar h3.title a', 0); $content = trim($element->innertext); - - $figCaption = strpos($content, $this->_NOM); + $figCaption = strpos($content, $category); + if($figCaption !== false) { - $content = str_replace('src="/', 'src="http://www.allocine.fr/',$content); - $content = str_replace('href="/', 'href="http://www.allocine.fr/',$content); - $content = str_replace('src=\'/', 'src=\'http://www.allocine.fr/',$content); - $content = str_replace('href=\'/', 'href=\'http://www.allocine.fr/',$content); + $content = str_replace('src="/', 'src="http://www.allocine.fr/', $content); + $content = str_replace('href="/', 'href="http://www.allocine.fr/', $content); + $content = str_replace('src=\'/', 'src=\'http://www.allocine.fr/', $content); + $content = str_replace('href=\'/', 'href=\'http://www.allocine.fr/', $content); $item->content = $content; - $item->title = trim($titre->innertext); - $item->uri = "http://www.allocine.fr" . $titre->href; + $item->title = trim($title->innertext); + $item->uri = "http://www.allocine.fr" . $title->href; $this->items[] = $item; } } } - public function getName(){ - return 'Allo Cine : ' . $this->_NOM; - } - - public function getURI(){ - return $this->_URL; - } - public function getCacheDuration(){ return 25200; // 7 hours } } -?> diff --git a/bridges/AllocineT5Bridge.php b/bridges/AllocineT5Bridge.php deleted file mode 100644 index 2dd1d81..0000000 --- a/bridges/AllocineT5Bridge.php +++ /dev/null @@ -1,54 +0,0 @@ -maintainer = "superbaillot.net"; - $this->name = "Allo Cine : Top 5"; - $this->uri = "http://www.allocine.fr/video/programme-12299/saison-22542/"; - $this->description = "Allo Cine : Top 5 via rss-bridge"; - $this->update = "2016-08-06"; - - } - - public function collectData(array $param){ - $html = $this->file_get_html($this->_URL) or $this->returnError('Could not request Allo cine.', 404); - - foreach($html->find('figure.media-meta-fig') as $element) - { - $item = new Item(); - - $titre = $element->find('div.titlebar h3.title a', 0); - $content = trim($element->innertext); - - $figCaption = strpos($content, $this->_NOM); - if($figCaption !== false) - { - $content = str_replace('src="/', 'src="http://www.allocine.fr/',$content); - $content = str_replace('href="/', 'href="http://www.allocine.fr/',$content); - $content = str_replace('src=\'/', 'src=\'http://www.allocine.fr/',$content); - $content = str_replace('href=\'/', 'href=\'http://www.allocine.fr/',$content); - $item->content = $content; - $item->title = trim($titre->innertext); - $item->uri = "http://www.allocine.fr" . $titre->href; - $this->items[] = $item; - } - } - } - - public function getName(){ - return 'Allo Cine : ' . $this->_NOM; - } - - public function getURI(){ - return $this->_URL; - } - - public function getCacheDuration(){ - return 25200; // 7 hours - } -} -?> diff --git a/bridges/AllocineTueursEnSerieBridge.php b/bridges/AllocineTueursEnSerieBridge.php deleted file mode 100644 index d4330ec..0000000 --- a/bridges/AllocineTueursEnSerieBridge.php +++ /dev/null @@ -1,54 +0,0 @@ -maintainer = "superbaillot.net"; - $this->name = "Allo Cine : Tueurs En Serie"; - $this->uri = "http://www.allocine.fr/video/programme-12286/saison-22938/"; - $this->description = "Allo Cine : Tueurs En Serie"; - $this->update = "2016-08-06"; - - } - - public function collectData(array $param){ - $html = $this->file_get_html($this->_URL) or $this->returnError('Could not request Allo cine.', 404); - - foreach($html->find('figure.media-meta-fig') as $element) - { - $item = new Item(); - - $titre = $element->find('div.titlebar h3.title a', 0); - $content = trim($element->innertext); - - $figCaption = strpos($content, $this->_NOM); - if($figCaption !== false) - { - $content = str_replace('src="/', 'src="http://www.allocine.fr/',$content); - $content = str_replace('href="/', 'href="http://www.allocine.fr/',$content); - $content = str_replace('src=\'/', 'src=\'http://www.allocine.fr/',$content); - $content = str_replace('href=\'/', 'href=\'http://www.allocine.fr/',$content); - $item->content = $content; - $item->title = trim($titre->innertext); - $item->uri = "http://www.allocine.fr" . $titre->href; - $this->items[] = $item; - } - } - } - - public function getName(){ - return 'Allo Cine : ' . $this->_NOM; - } - - public function getURI(){ - return $this->_URL; - } - - public function getCacheDuration(){ - return 25200; // 7 hours - } -} -?>