/** * 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; }
/** * 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; }