Exemplo n.º 1
0
 /**
  * Verifica se o documento é novo
  * @todo implementar get Raw
  */
 public static function isFresh($body, InterfaceLink $link, InterfaceSubscription $subscription)
 {
     if ($existent = $subscription->getLink($link->getId())) {
         if (SpiderText::diffPercentage($existent, $this->getBody()) < $this->getConfig('requirement_diff', 40)) {
             return false;
         }
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * Adiciona/subscreve elemento na fila
  */
 public function save(InterfaceLink $link)
 {
     if ($link instanceof InterfaceSubscription) {
         return false;
     }
     if ($link->isDone()) {
         $this->cache->save($link->getId('string'), $link->toPackage());
     }
     $this->_save($link->toMinimal());
     return $this;
 }