array( 'c' => array( '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); $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[] = array( 'uri' => 'https://sotawatch.sota.org.uk/en/', 'title' => $title, 'content' => $content, 'timestamp' => $spot['timeStamp'] ); } } }