From f01bc29f574260b309e126832183290d1991a163 Mon Sep 17 00:00:00 2001 From: gsurrel Date: Thu, 2 Jan 2014 11:26:15 +0100 Subject: [PATCH] Added Wikipedia FR bridge --- bridges/WikipediaFRBridge.php | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 bridges/WikipediaFRBridge.php diff --git a/bridges/WikipediaFRBridge.php b/bridges/WikipediaFRBridge.php new file mode 100755 index 0000000..3dad0c7 --- /dev/null +++ b/bridges/WikipediaFRBridge.php @@ -0,0 +1,39 @@ +returnError('Could not request Wikipedia FR.', 404); + + $element = $html->find('div[id=accueil-lumieresur]', 0); + $item = new \Item(); + $item->uri = $host.$element->find('p', 0)->find('a', 0)->href; + $item->title = $element->find('p',0)->find('a',0)->title; + $item->content = str_replace('href="', 'href="'.$host, $html->find('div[id=mf-lumieresur]', 0)->innertext); + $this->items[] = $item; + } + + public function getName(){ + return 'Wikipedia FR "Lumière sur..."'; + } + + public function getURI(){ + return 'https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Accueil_principal'; + } + + public function getCacheDuration(){ + return 0*3600*4; // 4 hours + } +}