1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-29 02:50:31 +02:00

bridges: use BridgeAbstract::getSimpleHTMLDOM

instead of BridgeAbstract::file_get_html

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière
2016-07-08 19:06:35 +02:00
parent f43bbda83e
commit 3c0d13c1bb
121 changed files with 1212 additions and 396 deletions

View File

@@ -15,7 +15,7 @@ function content_get_html($contents, $maxLen=-1, $lowercase = true, $forceTagsCl
}
class CpasbienBridge extends HttpCachingBridgeAbstract{
private $request;
public function loadMetadatas() {
@@ -44,7 +44,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
$html = '';
if (isset($param['q'])) { /* keyword search mode */
$this->request = str_replace(" ","-",trim($param['q']));
$html = $this->file_get_html($this->uri.'/recherche/'.urlencode($this->request).'.html') or $this->returnServerError('No results for this query.');
$html = $this->getSimpleHTMLDOM($this->uri.'/recherche/'.urlencode($this->request).'.html') or $this->returnServerError('No results for this query.');
}
else {
$this->returnClientError('You must specify a keyword (?q=...).');
@@ -53,7 +53,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
foreach ($html->find('#gauche',0)->find('div') as $episode) {
if ($episode->getAttribute('class')=='ligne0' || $episode->getAttribute('class')=='ligne1')
{
$htmlepisode=content_get_html($this->get_cached($episode->find('a', 0)->getAttribute('href')));
$item = new \Item();
@@ -65,7 +65,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
$item->content = $textefiche->text();
}
else {
$item->content = $htmlepisode->find('#textefiche', 0)->find('p',0)->text();
$item->content = $htmlepisode->find('#textefiche', 0)->find('p',0)->text();
}
$item->id = $episode->find('a', 0)->getAttribute('href');