コード例 #1
0
 public function search()
 {
     $data_to_search = Input::get("data");
     $archemy = new Archemy($data_to_search);
     //$archemy_response = $archemy->search($data_to_search);
     if ($archemy->status()) {
         $this->layout->content = View::make('archemy.show', array("response" => $archemy->response(), "relations" => $archemy->parseRelations(), "data" => $data_to_search));
     } else {
         return var_dump($archemy->response());
     }
 }
コード例 #2
0
 public function crawl()
 {
     if (!Input::has('url')) {
         return $this->layout->content = View::make('crawlurl');
     }
     $startURL = Input::get("url");
     $depth = Input::get("depth");
     $crawler = new crawler($startURL, $depth);
     //$crawler->setHttpAuth($username, $password);
     $crawler->run();
     $i = 0;
     echo sizeof($crawler->getSeen());
     foreach ($crawler->getSeen() as $url => $seen) {
         $archemy = new Archemy($url, 1);
         if ($archemy->status()) {
             $archemy->parseRelations();
             //array_merge($relations,);
         }
         echo $archemy->response();
         //echo $url."<br>";
     }
     $relations = Sentence::where("full_text", $startURL);
     $this->layout->content = View::make('archemy.show', array("response" => "", "relations" => $relations, "data" => $startURL));
 }