mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 10:04:54 +02:00
bridges: Fix bridges to pass unit test (#984)
* [DealabsBridge] fixed parameters * [DemonoidBridge] added parameter context names * [DevToBridge] fixed parameters * [ExtremeDownloadBridge] fixed parameters * [GithubIssueBridge] fixed parameters * [InstagramBridge] added parameter context names * [MydealsBridge] fixed parameters * [OnVaSortirBridge] fixed parameters * [ThingyverseBridge] fixed parameters * [HotUKDealsBridge] fixed parameters * [FeedExpanderExample] added proper URI * [GQMagazineBridge] fixed parameters and getDomain() * [MozillaSecurityBridge] fixed filename References #980
This commit is contained in:
parent
f3f33cabed
commit
288d4de218
13 changed files with 102 additions and 104 deletions
28
bridges/MozillaSecurityBridge.php
Normal file
28
bridges/MozillaSecurityBridge.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
class MozillaSecurityBridge extends BridgeAbstract {
|
||||
|
||||
const MAINTAINER = 'm0le.net';
|
||||
const NAME = 'Mozilla Security Advisories';
|
||||
const URI = 'https://www.mozilla.org/en-US/security/advisories/';
|
||||
const CACHE_TIMEOUT = 7200; // 2h
|
||||
const DESCRIPTION = 'Mozilla Security Advisories';
|
||||
const WEBROOT = 'https://www.mozilla.org';
|
||||
|
||||
public function collectData(){
|
||||
$html = getSimpleHTMLDOM(self::URI)
|
||||
or returnServerError('Could not request MSA.');
|
||||
|
||||
$html = defaultLinkTo($html, self::WEBROOT);
|
||||
|
||||
$item = array();
|
||||
$articles = $html->find('div[itemprop="articleBody"] h2');
|
||||
|
||||
foreach ($articles as $element) {
|
||||
$item['title'] = $element->innertext;
|
||||
$item['timestamp'] = strtotime($element->innertext);
|
||||
$item['content'] = $element->next_sibling()->innertext;
|
||||
$item['uri'] = self::URI;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue