From 40a4e7b7c238af6e4d53a55948352e8ad898df19 Mon Sep 17 00:00:00 2001 From: Jacob Zelek Date: Fri, 1 Apr 2022 11:17:00 -0700 Subject: [PATCH] [ParksOnTheAir] New bridge for amateur radio (#2086) --- bridges/ParksOnTheAirBridge.php | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 bridges/ParksOnTheAirBridge.php diff --git a/bridges/ParksOnTheAirBridge.php b/bridges/ParksOnTheAirBridge.php new file mode 100644 index 00000000..f46ffc43 --- /dev/null +++ b/bridges/ParksOnTheAirBridge.php @@ -0,0 +1,39 @@ + 1); + $json = getContents($this->getURI(), $header, $opts); + + $spots = json_decode($json, true); + + foreach ($spots as $spot) { + $title = $spot['activator'] . ' @ ' . $spot['reference'] . ' ' . + $spot['frequency'] . ' kHz'; + + $content = << +{$spot['reference']}, {$spot['name']}
+Location: {$spot['locationDesc']}
+Frequency: {$spot['frequency']} kHz
+Spotter: {$spot['spotter']}
+Comments: {$spot['comments']} +EOL; + + $this->items[] = array( + 'uri' => 'https://pota.us/#/', + 'title' => $title, + 'content' => $content, + 'timestamp' => $spot['spotTime'] + ); + } + } +}