-
Notifications
You must be signed in to change notification settings - Fork 1
/
SignalBridge.php
34 lines (25 loc) · 960 Bytes
/
SignalBridge.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
class SignalBridge extends FeedExpander {
const NAME = 'Signal Messenger Bridge';
const URI = 'https://signal.org/blog/';
const DESCRIPTION = 'Returns newest posts from the Signal Messenger blog';
const MAINTAINER = 'VerifiedJoseph';
const PARAMETERS = array();
const CACHE_TIMEOUT = 3600; // 1 hour
protected function parseItem($item) {
$item = parent::parseItem($item);
$html = getSimpleHTMLDOMCached($item['uri'])
or returnServerError('Could not request: ' . $item['uri']);
$html = defaultLinkTo($html, $this->getURI());
$content = $html->find('div.blog-post-content', 0);
$content->find('div.social-sharing', 0)->outertext = '';
$item['content'] = $content;
if ($html->find('meta[property="og:image"]', 0)) {
$item['enclosures'][] = $html->find('meta[property="og:image"]', 0)->content;
}
return $item;
}
public function collectData() {
$this->collectExpandableDatas($this->getURI() . 'rss.xml', 10);
}
}