mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
Add RainLoopBridge (#3423)
This commit is contained in:
parent
08be0ad7a5
commit
3f8165207e
1 changed files with 40 additions and 0 deletions
40
bridges/RainLoopBridge.php
Normal file
40
bridges/RainLoopBridge.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
class RainLoopBridge extends BridgeAbstract
|
||||
{
|
||||
const MAINTAINER = 'Simounet';
|
||||
const NAME = 'RainLoop';
|
||||
const URI_BASE = 'https://www.rainloop.net';
|
||||
const URI = self::URI_BASE . '/changelog/';
|
||||
const CACHE_TIMEOUT = 21600; //6h
|
||||
const DESCRIPTION = 'RainLoop\'s changelog';
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
$html = getSimpleHTMLDOM(self::URI);
|
||||
|
||||
$mainContent = $html->find('.main-center', 0);
|
||||
$elements = $mainContent->find('.row-fluid');
|
||||
foreach ($elements as $i => $element) {
|
||||
if ($i === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$titleEl = $element->find('.h3', 0);
|
||||
$title = is_object($titleEl) ? $titleEl->plaintext : '';
|
||||
|
||||
$postUrl = self::URI . $title;
|
||||
|
||||
$contentEl = $element->find('.span9', 0);
|
||||
$content = is_object($contentEl) ? $contentEl->xmltext() : '';
|
||||
|
||||
$item = [];
|
||||
$item['uri'] = $postUrl;
|
||||
$item['title'] = $title;
|
||||
$item['content'] = $content;
|
||||
$item['timestamp'] = strtotime('now');
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue