From 91ae2a23d758b1010f68935e877e37fbb5db9178 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 21 Jul 2018 17:36:38 +0200 Subject: [PATCH] [CpasbienBridge] Remove bridge Removing this bridge for two reasons: 1) The service moved from www.cpasbien.cm to www.torrents9.blue, changing the layout in the process (incompatible). 2) The new site is permanently protected by Cloudflare IUAM, making it inaccessible by RSS-Bridge. While it would certainly be possible to rewrite the bridge to work with the new layout, the site is still inaccessible. References #605 --- bridges/CpasbienBridge.php | 74 -------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 bridges/CpasbienBridge.php diff --git a/bridges/CpasbienBridge.php b/bridges/CpasbienBridge.php deleted file mode 100644 index f9b4b502..00000000 --- a/bridges/CpasbienBridge.php +++ /dev/null @@ -1,74 +0,0 @@ - array( - 'name' => 'Search', - 'required' => true, - 'title' => 'Type your search' - ) - )); - - public function collectData(){ - $request = str_replace(' ', '-', trim($this->getInput('q'))); - $html = getSimpleHTMLDOM(self::URI . '/recherche/' . urlencode($request) . '.html') - or returnServerError('No results for this query.'); - - foreach($html->find('#gauche', 0)->find('div') as $episode) { - if($episode->getAttribute('class') == 'ligne0' - || $episode->getAttribute('class') == 'ligne1') { - - $urlepisode = $episode->find('a', 0)->getAttribute('href'); - $htmlepisode = getSimpleHTMLDOMCached($urlepisode, 86400 * 366 * 30); - - $item = array(); - $item['author'] = $episode->find('a', 0)->text(); - $item['title'] = $episode->find('a', 0)->text(); - $item['pubdate'] = $this->getCachedDate($urlepisode); - $textefiche = $htmlepisode->find('#textefiche', 0)->find('p', 1); - - if(isset($textefiche)) { - $item['content'] = $textefiche->text(); - } else { - $p = $htmlepisode->find('#textefiche', 0)->find('p'); - if(!empty($p)) { - $item['content'] = $htmlepisode->find('#textefiche', 0)->find('p', 0)->text(); - } - } - - $item['id'] = $episode->find('a', 0)->getAttribute('href'); - $item['uri'] = self::URI . $htmlepisode->find('#telecharger', 0)->getAttribute('href'); - $this->items[] = $item; - } - } - } - - public function getName(){ - if(!is_null($this->getInput('q'))) { - return $this->getInput('q') . ' : ' . self::NAME; - } - - return parent::getName(); - } - - private function getCachedDate($url){ - debugMessage('getting pubdate from url ' . $url . ''); - - // Initialize cache - $cache = Cache::create('FileCache'); - $cache->setPath(CACHE_DIR . '/pages'); - - $params = [$url]; - $cache->setParameters($params); - - // Get cachefile timestamp - $time = $cache->getTime(); - return ($time !== false ? $time : time()); - } -}