Exemplo n.º 1
0
 /**
  * Sets the resulting web of the crawl to this report
  * @param zibo\library\spider\Web $web The resulting web of the crawl
  * @return null
  */
 public function setWeb(Web $web)
 {
     $this->nodes = array();
     $nodes = $web->getNodes();
     foreach ($nodes as $node) {
         if (!$node->hasType(WebNode::TYPE_MAILTO) || $node->hasType(WebNode::TYPE_IGNORED)) {
             continue;
         }
         $this->nodes[$node->getUrl()] = $node;
     }
     ksort($this->nodes);
 }
Exemplo n.º 2
0
 /**
  * Sets the resulting web of the crawl to this report
  * @param zibo\library\spider\Web $web The resulting web of the crawl
  * @return null
  */
 public function setWeb(Web $web)
 {
     $this->nodes = array();
     $nodes = $web->getNodes();
     foreach ($nodes as $node) {
         $response = $node->getResponse();
         if (!$node->getError() && ($node->hasType(WebNode::TYPE_IGNORED) || $node->hasType(WebNode::TYPE_MAILTO) || $response && ($response->isRedirect() || $response->getResponseCode() == 200))) {
             continue;
         }
         $this->nodes[$node->getUrl()] = $node;
     }
     ksort($this->nodes);
 }
Exemplo n.º 3
0
 /**
  * Sets the resulting web of the crawl to this report
  * @param zibo\library\spider\Web $web The resulting web of the crawl
  * @return null
  */
 public function setWeb(Web $web)
 {
     $this->nodes = array();
     $nodes = $web->getNodes();
     foreach ($nodes as $node) {
         if ($node->hasType(WebNode::TYPE_IGNORED)) {
             continue;
         }
         $response = $node->getResponse();
         if ($response && $response->getResponseCode() == 200 && !$node->getError()) {
             $this->nodes[$node->getUrl()] = $node;
         }
     }
     ksort($this->nodes);
 }