mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-25 02:46:15 +03:00
[TheRedHandFiles]: New Bridge (#3229)
This blog had a feed, is updated irregularly, and someone disabled the feed on the Wordpress config on purpose for some reason. :(
This commit is contained in:
parent
e44e458617
commit
b21806a0b3
1 changed files with 29 additions and 0 deletions
29
bridges/TheRedHandFilesBridge.php
Normal file
29
bridges/TheRedHandFilesBridge.php
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class TheRedHandFilesBridge extends BridgeAbstract
|
||||||
|
{
|
||||||
|
const NAME = 'The Red Hand Files';
|
||||||
|
const URI = 'https://www.theredhandfiles.com';
|
||||||
|
const DESCRIPTION = 'The Red Hand Files, a Q&A blog by Nick Cave';
|
||||||
|
const MAINTAINER = 'somini';
|
||||||
|
/* The feed was available here: 'https://www.theredhandfiles.com/feed/'; */
|
||||||
|
|
||||||
|
public function collectData()
|
||||||
|
{
|
||||||
|
$html = getSimpleHTMLDOM($this->getURI());
|
||||||
|
|
||||||
|
foreach ($html->find('#main article.posts__article') as $element) {
|
||||||
|
$item = [];
|
||||||
|
|
||||||
|
$html_title = $element->find('h2', 0);
|
||||||
|
$html_subtitle = $element->find('h3', 0);
|
||||||
|
$html_image = $element->find('.posts__article-img', 0);
|
||||||
|
|
||||||
|
$item['title'] = $html_subtitle->plaintext;
|
||||||
|
$item['uri'] = $html_title->find('a', 0)->href;
|
||||||
|
$item['content'] = $html_image->innertext . $html_title->plaintext;
|
||||||
|
|
||||||
|
$this->items[] = $item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue