1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-09 10:06:33 +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,37 +1,38 @@
<?php
class SummitsOnTheAirBridge extends BridgeAbstract {
const MAINTAINER = 's0lesurviv0r';
const NAME = 'Summits On The Air Spots';
const URI = 'https://api2.sota.org.uk/api/spots/';
const CACHE_TIMEOUT = 60; // 1m
const DESCRIPTION = 'Summits On The Air Activator Spots';
class SummitsOnTheAirBridge extends BridgeAbstract
{
const MAINTAINER = 's0lesurviv0r';
const NAME = 'Summits On The Air Spots';
const URI = 'https://api2.sota.org.uk/api/spots/';
const CACHE_TIMEOUT = 60; // 1m
const DESCRIPTION = 'Summits On The Air Activator Spots';
const PARAMETERS = array(
'Count' => array(
'c' => array(
'name' => 'count',
'required' => true,
'defaultValue' => 10
)
)
);
const PARAMETERS = [
'Count' => [
'c' => [
'name' => 'count',
'required' => true,
'defaultValue' => 10
]
]
];
public function collectData()
{
$header = array('Content-type:application/json');
$opts = array(CURLOPT_HTTPGET => 1);
$json = getContents($this->getURI() . $this->getInput('c'), $header, $opts);
public function collectData()
{
$header = ['Content-type:application/json'];
$opts = [CURLOPT_HTTPGET => 1];
$json = getContents($this->getURI() . $this->getInput('c'), $header, $opts);
$spots = json_decode($json, true);
$spots = json_decode($json, true);
foreach ($spots as $spot) {
$summit = $spot['associationCode'] . '/' . $spot['summitCode'];
foreach ($spots as $spot) {
$summit = $spot['associationCode'] . '/' . $spot['summitCode'];
$title = $spot['activatorCallsign'] . ' @ ' . $summit . ' ' .
$spot['frequency'] . ' MHz';
$title = $spot['activatorCallsign'] . ' @ ' . $summit . ' ' .
$spot['frequency'] . ' MHz';
$content = <<<EOL
$content = <<<EOL
<a href="http://summits.sota.org.uk/summit/{$summit}">
{$summit}, {$spot['summitDetails']}</a><br />
Frequency: {$spot['frequency']} MHz<br />
@@ -39,12 +40,12 @@ class SummitsOnTheAirBridge extends BridgeAbstract {
Comments: {$spot['comments']}
EOL;
$this->items[] = array(
'uri' => 'https://sotawatch.sota.org.uk/en/',
'title' => $title,
'content' => $content,
'timestamp' => $spot['timeStamp']
);
}
}
$this->items[] = [
'uri' => 'https://sotawatch.sota.org.uk/en/',
'title' => $title,
'content' => $content,
'timestamp' => $spot['timeStamp']
];
}
}
}