mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-26 03:16:33 +03:00
[SensCritique] Fix search display (#1567)
- Remove movies search. It appears the website changed their movies displays and data cannot be easily extracted for now. - Fix some errors on items without proper description and/or original title.
This commit is contained in:
parent
8047041963
commit
9a66227a79
1 changed files with 13 additions and 14 deletions
|
@ -3,15 +3,11 @@ class SensCritiqueBridge extends BridgeAbstract {
|
||||||
|
|
||||||
const MAINTAINER = 'kranack';
|
const MAINTAINER = 'kranack';
|
||||||
const NAME = 'Sens Critique';
|
const NAME = 'Sens Critique';
|
||||||
const URI = 'http://www.senscritique.com/';
|
const URI = 'https://www.senscritique.com/';
|
||||||
const CACHE_TIMEOUT = 21600; // 6h
|
const CACHE_TIMEOUT = 21600; // 6h
|
||||||
const DESCRIPTION = 'Sens Critique news';
|
const DESCRIPTION = 'Sens Critique news';
|
||||||
|
|
||||||
const PARAMETERS = array( array(
|
const PARAMETERS = array( array(
|
||||||
'm' => array(
|
|
||||||
'name' => 'Movies',
|
|
||||||
'type' => 'checkbox'
|
|
||||||
),
|
|
||||||
's' => array(
|
's' => array(
|
||||||
'name' => 'Series',
|
'name' => 'Series',
|
||||||
'type' => 'checkbox'
|
'type' => 'checkbox'
|
||||||
|
@ -40,8 +36,6 @@ class SensCritiqueBridge extends BridgeAbstract {
|
||||||
if($this->getInput($category)) {
|
if($this->getInput($category)) {
|
||||||
$uri = self::URI;
|
$uri = self::URI;
|
||||||
switch($category) {
|
switch($category) {
|
||||||
case 'm': $uri .= 'films/cette-semaine';
|
|
||||||
break;
|
|
||||||
case 's': $uri .= 'series/actualite';
|
case 's': $uri .= 'series/actualite';
|
||||||
break;
|
break;
|
||||||
case 'g': $uri .= 'jeuxvideo/actualite';
|
case 'g': $uri .= 'jeuxvideo/actualite';
|
||||||
|
@ -77,20 +71,25 @@ class SensCritiqueBridge extends BridgeAbstract {
|
||||||
. ' '
|
. ' '
|
||||||
. $movie->find('.elco-date', 0)->plaintext;
|
. $movie->find('.elco-date', 0)->plaintext;
|
||||||
|
|
||||||
$item['content'] = '<em>'
|
$item['content'] = '';
|
||||||
. $movie->find('.elco-original-title', 0)->plaintext
|
$originalTitle = $movie->find('.elco-original-title', 0);
|
||||||
. '</em><br><br>'
|
$description = $movie->find('.elco-description', 0);
|
||||||
. $movie->find('.elco-baseline', 0)->plaintext
|
|
||||||
|
if ($originalTitle) {
|
||||||
|
$item['content'] = '<em>' . $originalTitle->plaintext . '</em><br><br>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$item['content'] .= $movie->find('.elco-baseline', 0)->plaintext
|
||||||
. '<br>'
|
. '<br>'
|
||||||
. $movie->find('.elco-baseline', 1)->plaintext
|
. $movie->find('.elco-baseline', 1)->plaintext
|
||||||
. '<br><br>'
|
. '<br><br>'
|
||||||
. $movie->find('.elco-description', 0)->plaintext
|
. ($description ? $description->plaintext : '')
|
||||||
. '<br><br>'
|
. '<br><br>'
|
||||||
. trim($movie->find('.erra-ratings .erra-global', 0)->plaintext)
|
. trim($movie->find('.erra-ratings .erra-global', 0)->plaintext)
|
||||||
. ' / 10';
|
. ' / 10';
|
||||||
|
|
||||||
$item['id'] = $this->getURI() . $movie->find('.elco-title a', 0)->href;
|
$item['id'] = $this->getURI() . ltrim($movie->find('.elco-title a', 0)->href, '/');
|
||||||
$item['uri'] = $this->getURI() . $movie->find('.elco-title a', 0)->href;
|
$item['uri'] = $this->getURI() . ltrim($movie->find('.elco-title a', 0)->href, '/');
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue