1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-06 08:37:30 +02:00

Reformat codebase v4 (#2872)

Reformat code base to PSR12

Co-authored-by: rssbridge <noreply@github.com>
This commit is contained in:
Dag
2022-07-01 15:10:30 +02:00
committed by GitHub
parent 66568e3a39
commit 4f75591060
398 changed files with 58607 additions and 56442 deletions

View File

@@ -1,36 +1,40 @@
<?php
class OpenwrtSecurityBridge extends BridgeAbstract {
const NAME = 'OpenWrt Security Advisories';
const URI = 'https://openwrt.org/advisory/start';
const DESCRIPTION = 'Security Advisories published by openwrt.org';
const MAINTAINER = 'mschwld';
const CACHE_TIMEOUT = 3600;
const WEBROOT = 'https://openwrt.org';
public function collectData() {
$item = array();
$html = getSimpleHTMLDOM(self::URI);
class OpenwrtSecurityBridge extends BridgeAbstract
{
const NAME = 'OpenWrt Security Advisories';
const URI = 'https://openwrt.org/advisory/start';
const DESCRIPTION = 'Security Advisories published by openwrt.org';
const MAINTAINER = 'mschwld';
const CACHE_TIMEOUT = 3600;
const WEBROOT = 'https://openwrt.org';
$advisories = $html->find('div[class=plugin_nspages]', 0);
public function collectData()
{
$item = [];
$html = getSimpleHTMLDOM(self::URI);
foreach($advisories->find('a[class=wikilink1]') as $element) {
$item = array();
$advisories = $html->find('div[class=plugin_nspages]', 0);
$row = $element->innertext;
foreach ($advisories->find('a[class=wikilink1]') as $element) {
$item = [];
$item['title'] = substr($row, 0, strpos($row, ' - '));
$item['timestamp'] = $this->getDate($element->href);
$item['uri'] = self::WEBROOT . $element->href;
$item['uid'] = self::WEBROOT . $element->href;
$item['content'] = substr($row, strpos($row, ' - ') + 3);
$item['author'] = 'OpenWrt Project';
$row = $element->innertext;
$this->items[] = $item;
}
}
$item['title'] = substr($row, 0, strpos($row, ' - '));
$item['timestamp'] = $this->getDate($element->href);
$item['uri'] = self::WEBROOT . $element->href;
$item['uid'] = self::WEBROOT . $element->href;
$item['content'] = substr($row, strpos($row, ' - ') + 3);
$item['author'] = 'OpenWrt Project';
private function getDate($href) {
$date = substr($href, -12);
return $date;
}
$this->items[] = $item;
}
}
private function getDate($href)
{
$date = substr($href, -12);
return $date;
}
}