mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[VieDeMerdeBridge] fix due to website changes (#2567)
This commit is contained in:
parent
d27c1a99c2
commit
d6a4f2fd5b
@ -3,7 +3,7 @@ class VieDeMerdeBridge extends BridgeAbstract {
|
|||||||
|
|
||||||
const MAINTAINER = 'floviolleau';
|
const MAINTAINER = 'floviolleau';
|
||||||
const NAME = 'VieDeMerde Bridge';
|
const NAME = 'VieDeMerde Bridge';
|
||||||
const URI = 'https://viedemerde.fr';
|
const URI = 'https://www.viedemerde.fr';
|
||||||
const DESCRIPTION = 'Returns latest quotes from VieDeMerde.';
|
const DESCRIPTION = 'Returns latest quotes from VieDeMerde.';
|
||||||
const CACHE_TIMEOUT = 7200;
|
const CACHE_TIMEOUT = 7200;
|
||||||
|
|
||||||
@ -23,16 +23,15 @@ class VieDeMerdeBridge extends BridgeAbstract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$html = getSimpleHTMLDOM(self::URI, array());
|
$html = getSimpleHTMLDOM(self::URI, array());
|
||||||
|
$quotes = $html->find('article.bg-white');
|
||||||
$quotes = $html->find('article.article-panel');
|
|
||||||
if(sizeof($quotes) === 0) {
|
if(sizeof($quotes) === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($quotes as $quote) {
|
foreach($quotes as $quote) {
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['uri'] = self::URI . $quote->find('.article-contents a', 0)->href;
|
$item['uri'] = self::URI . $quote->find('a', 0)->href;
|
||||||
$titleContent = $quote->find('.article-contents a h2.classic-title', 0);
|
$titleContent = $quote->find('h2', 0);
|
||||||
|
|
||||||
if($titleContent) {
|
if($titleContent) {
|
||||||
$item['title'] = html_entity_decode($titleContent->plaintext, ENT_QUOTES);
|
$item['title'] = html_entity_decode($titleContent->plaintext, ENT_QUOTES);
|
||||||
@ -40,9 +39,11 @@ class VieDeMerdeBridge extends BridgeAbstract {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$quote->find('.article-contents a h2.classic-title', 0)->outertext = '';
|
$quoteText = $quote->find('a', 1)->plaintext;
|
||||||
$item['content'] = $quote->find('.article-contents a', 0)->innertext;
|
$isAVDM = $quote->find('.vote-btn', 0)->plaintext;
|
||||||
$item['author'] = $quote->find('.article-topbar', 0)->innertext;
|
$isNotAVDM = $quote->find('.vote-btn', 1)->plaintext;
|
||||||
|
$item['content'] = $quoteText . '<br>' . $isAVDM . '<br>' . $isNotAVDM;
|
||||||
|
$item['author'] = $quote->find('p', 0)->plaintext;
|
||||||
$item['uid'] = hash('sha256', $item['title']);
|
$item['uid'] = hash('sha256', $item['title']);
|
||||||
|
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
|
Loading…
Reference in New Issue
Block a user