2015-09-01 20:45:39 +03:00
|
|
|
<?php
|
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
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';
|
2015-11-04 01:28:44 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
public function collectData()
|
|
|
|
{
|
|
|
|
$this->collectExpandableDatas(static::URI . 'feed/all/rss.xml', 20);
|
|
|
|
}
|
2015-09-01 20:45:39 +03:00
|
|
|
|
2023-10-13 02:59:05 +03:00
|
|
|
protected function parseItem(array $item)
|
2022-07-01 16:10:30 +03:00
|
|
|
{
|
2023-10-13 01:25:34 +03:00
|
|
|
$articlePage = getSimpleHTMLDOMCached($item['uri']);
|
2022-07-01 16:10:30 +03:00
|
|
|
$content = $articlePage->find('.article-text, depeche-text', 0);
|
|
|
|
if (!$content) {
|
|
|
|
return $item;
|
|
|
|
}
|
|
|
|
$item['content'] = sanitize($content);
|
2016-03-02 14:49:27 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
return $item;
|
|
|
|
}
|
2015-09-01 20:45:39 +03:00
|
|
|
}
|