Exemplo n.º 1
0
 if (!$extract_result) {
     if ($exclude_on_fail) {
         continue;
     }
     // skip this and move to next item
     //TODO: get text sample for language detection
     if (!$valid_key) {
         $html = $options->error_message;
     } else {
         $html = $options->error_message_with_key;
     }
     // keep the original item description
     $html .= $item->get_description();
     //echo "[" . $html . "]";
 } else {
     $readability->clean($content_block, 'select');
     if ($options->rewrite_relative_urls) {
         makeAbsolute($effective_url, $content_block);
     }
     // footnotes
     if ($links == 'footnotes' && strpos($effective_url, 'wikipedia.org') === false) {
         //$readability->addFootnotes($content_block);
     }
     if ($extract_pattern) {
         // get outerHTML
         $html = $content_block->ownerDocument->saveXML($content_block);
         echo "extract_pattern: [" . $html . "]";
     } else {
         //echo "content_block: [" . $html . "]";
         if ($content_block->childNodes->length == 1 && $content_block->firstChild->nodeType === XML_ELEMENT_NODE) {
             $html = $content_block->firstChild->innerHTML;