コード例 #1
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // message
     $data = array('type' => $this->argument('type'), 'id' => $this->argument('id'), 'date' => $this->argument('date'));
     // fire
     $scraper = new Scraper();
     $scraper->execute($data);
 }
コード例 #2
0
 function get_scraper($service_agenda, $periodo, $curso)
 {
     $scraper = new \Scraper();
     $response = $this->get_html($service_agenda, $periodo, $curso);
     if (!$response['status']) {
         //se presenta un error en la consulta del html
         return $response;
     }
     $result = $scraper->execute('#contenido table tr td table tr td', $response['content']);
     //contenido
     if ($result == null) {
         //vuelve a intentar con otro formato
         $result = $scraper->execute('#contenido table tr td', $response['content']);
         //contenido
         return array("status" => true, "result" => $result[0], "code" => 200);
     } else {
         //OK
         return array("status" => true, "result" => $result, "code" => 200);
     }
 }