2014-05-26 02:30:46 +04:00
|
|
|
<?php
|
2015-11-04 01:28:44 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
class AcrimedBridge extends FeedExpander
|
|
|
|
{
|
|
|
|
const MAINTAINER = 'qwertygc';
|
|
|
|
const NAME = 'Acrimed Bridge';
|
|
|
|
const URI = 'https://www.acrimed.org/';
|
|
|
|
const CACHE_TIMEOUT = 4800; //2hours
|
|
|
|
const DESCRIPTION = 'Returns the newest articles';
|
2015-11-03 17:36:19 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
const PARAMETERS = [
|
|
|
|
[
|
|
|
|
'limit' => [
|
|
|
|
'name' => 'limit',
|
|
|
|
'type' => 'number',
|
|
|
|
'defaultValue' => -1,
|
|
|
|
]
|
|
|
|
]
|
|
|
|
];
|
2022-03-25 22:59:23 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
public function collectData()
|
|
|
|
{
|
2023-10-13 01:25:34 +03:00
|
|
|
$url = 'https://www.acrimed.org/spip.php?page=backend';
|
|
|
|
$limit = $this->getInput('limit');
|
|
|
|
$this->collectExpandableDatas($url, $limit);
|
2022-07-01 16:10:30 +03:00
|
|
|
}
|
2016-02-26 21:41:35 +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 = getSimpleHTMLDOM($item['uri']);
|
2022-07-01 16:10:30 +03:00
|
|
|
$article = sanitize($articlePage->find('article.article1', 0)->innertext);
|
|
|
|
$article = defaultLinkTo($article, static::URI);
|
|
|
|
$item['content'] = $article;
|
2016-02-26 21:41:35 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
return $item;
|
|
|
|
}
|
2014-05-26 02:30:46 +04:00
|
|
|
}
|