[ 'name' => 'Channel name', 'type' => 'text', 'required' => true, 'title' => 'Channel name', 'exampleValue' => 'Wysdrem', ], ] ]; public function collectData() { $channel = $this->getInput('channel'); $data = json_decode(getContents('https://api.picarto.tv/api/v1/channel/name/' . $channel), true); if (!$data['online']) { return; } $lastLive = new \DateTime($data['last_live']); $this->items[] = [ 'uri' => 'https://picarto.tv/' . $channel, 'title' => $data['name'] . ' is now online', 'content' => sprintf('', $data['thumbnails']['tablet']), 'timestamp' => $lastLive->getTimestamp(), 'uid' => 'https://picarto.tv/' . $channel . $lastLive->getTimestamp(), ]; } public function getName() { return 'Picarto - ' . $this->getInput('channel'); } }