[ParksOnTheAirBridge] Fix links (#2590)

This commit is contained in:
Yaman Qalieh 2022-04-02 06:53:10 -04:00 committed by GitHub
parent f311fb8083
commit fb0e7ede89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,8 @@
class ParksOnTheAirBridge extends BridgeAbstract {
const MAINTAINER = 's0lesurviv0r';
const NAME = 'Parks On The Air Spots';
const URI = 'https://api.pota.app/spot/activator';
const URI = 'https://pota.app/#';
const API_URI = 'https://api.pota.app/spot/activator';
const CACHE_TIMEOUT = 60; // 1m
const DESCRIPTION = 'Parks On The Air Activator Spots';
@ -11,16 +12,17 @@ class ParksOnTheAirBridge extends BridgeAbstract {
$header = array('Content-type:application/json');
$opts = array(CURLOPT_HTTPGET => 1);
$json = getContents($this->getURI(), $header, $opts);
$json = getContents(self::API_URI, $header, $opts);
$spots = json_decode($json, true);
foreach ($spots as $spot) {
$title = $spot['activator'] . ' @ ' . $spot['reference'] . ' ' .
$spot['frequency'] . ' kHz';
$park_link = self::URI . '/park/' . $spot['reference'];
$content = <<<EOL
<a href="https://pota.us/#/parks/{$spot['reference']}">
<a href="{$park_link}">
{$spot['reference']}, {$spot['name']}</a><br />
Location: {$spot['locationDesc']}<br />
Frequency: {$spot['frequency']} kHz<br />
@ -29,7 +31,7 @@ Comments: {$spot['comments']}
EOL;
$this->items[] = array(
'uri' => 'https://pota.us/#/',
'uri' => $park_link,
'title' => $title,
'content' => $content,
'timestamp' => $spot['spotTime']