[ 'c' => [ 'name' => 'count', 'required' => true, 'defaultValue' => 10 ] ] ]; 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); foreach ($spots as $spot) { $summit = $spot['associationCode'] . '/' . $spot['summitCode']; $title = $spot['activatorCallsign'] . ' @ ' . $summit . ' ' . $spot['frequency'] . ' MHz'; $content = << {$summit}, {$spot['summitDetails']}
Frequency: {$spot['frequency']} MHz
Mode: {$spot['mode']}
Comments: {$spot['comments']} EOL; $this->items[] = [ 'uri' => 'https://sotawatch.sota.org.uk/en/', 'title' => $title, 'content' => $content, 'timestamp' => $spot['timeStamp'] ]; } } }