mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-12-25 13:48:21 +03:00
27 lines
729 B
PHP
27 lines
729 B
PHP
<?php
|
|
class CourrierInternationalBridge extends FeedExpander {
|
|
|
|
const MAINTAINER = 'teromene';
|
|
const NAME = 'Courrier International Bridge';
|
|
const URI = 'https://www.courrierinternational.com/';
|
|
const CACHE_TIMEOUT = 300; // 5 min
|
|
const DESCRIPTION = 'Returns the newest articles';
|
|
|
|
public function collectData(){
|
|
$this->collectExpandableDatas(static::URI . 'feed/all/rss.xml', 20);
|
|
}
|
|
|
|
protected function parseItem($feedItem){
|
|
$item = parent::parseItem($feedItem);
|
|
|
|
$articlePage = getSimpleHTMLDOMCached($feedItem->link);
|
|
$content = $articlePage->find('.article-text', 0);
|
|
if(!$content) {
|
|
$content = $articlePage->find('.depeche-text', 0);
|
|
}
|
|
|
|
$item['content'] = sanitize($content);
|
|
|
|
return $item;
|
|
}
|
|
}
|