/** * Handle the request * * Make a new notice for the update, save it, and show it * * @param array $args $_REQUEST data (unused) * * @return void */ protected function handle() { parent::handle(); $file = new File(); $file->selectAdd(); // clears it $file->selectAdd('url'); $file->id = $this->trimmed('id'); $url = $file->fetchAll('url'); $file_txt = ''; if (strstr($url[0], '.html')) { $file_txt['txt'] = file_get_contents($url[0]); $file_txt['body_start'] = strpos($file_txt['txt'], '<body>') + 6; $file_txt['body_end'] = strpos($file_txt['txt'], '</body>'); $file_txt = substr($file_txt['txt'], $file_txt['body_start'], $file_txt['body_end'] - $file_txt['body_start']); } $this->initDocument('json'); $this->showJsonObjects($file_txt); $this->endDocument('json'); }