mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-12-18 08:54:20 +03:00
[HarvardHealthBlogBridge] Update (#4117)
Make article image optional as all images are representative
This commit is contained in:
parent
bd90109c70
commit
cfd406861e
1 changed files with 18 additions and 3 deletions
|
@ -7,6 +7,15 @@ class HarvardHealthBlogBridge extends BridgeAbstract
|
||||||
const DESCRIPTION = 'Retrieve articles from health.harvard.edu';
|
const DESCRIPTION = 'Retrieve articles from health.harvard.edu';
|
||||||
const MAINTAINER = 'tillcash';
|
const MAINTAINER = 'tillcash';
|
||||||
const MAX_ARTICLES = 10;
|
const MAX_ARTICLES = 10;
|
||||||
|
const PARAMETERS = [
|
||||||
|
[
|
||||||
|
'image' => [
|
||||||
|
'name' => 'Article Image',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'defaultValue' => 'checked',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
public function collectData()
|
public function collectData()
|
||||||
{
|
{
|
||||||
|
@ -46,9 +55,15 @@ class HarvardHealthBlogBridge extends BridgeAbstract
|
||||||
return 'Content Not Found';
|
return 'Content Not Found';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove ads
|
// remove article image
|
||||||
foreach ($article->find('.inline-ad') as $remove) {
|
if (!$this->getInput('image')) {
|
||||||
$remove->outertext = '';
|
$image = $article->find('p', 0);
|
||||||
|
$image->remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove ads
|
||||||
|
foreach ($article->find('.inline-ad') as $ad) {
|
||||||
|
$ad->outertext = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $article->innertext;
|
return $article->innertext;
|
||||||
|
|
Loading…
Reference in a new issue