mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-25 02:46:15 +03:00
b21806a0b3
This blog had a feed, is updated irregularly, and someone disabled the feed on the Wordpress config on purpose for some reason. :(
29 lines
953 B
PHP
29 lines
953 B
PHP
<?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;
|
|
}
|
|
}
|
|
}
|