diff --git a/epub.php b/epub.php index 3175417..fe2566b 100644 --- a/epub.php +++ b/epub.php @@ -205,9 +205,6 @@ foreach ($node->childNodes as $childNode){ $innerHTML .= $childNode->ownerDocument->saveHTML($childNode); } - $outerHTML = $node->ownerDocument->saveHTML($node); - $textcontent = $node->textContent; - $result .= '
') . '
' . $summary . '
'; $nodes = $finder->query('//section[@name="articleBody"]'); - /*if (!$nodes->length) - { - // articles accès libre - $nodes = $finder->query('//div[contains(@class, "news__body__center__article")]'); - }*/ if (!$nodes->length) { @@ -294,8 +285,6 @@ foreach ($node->childNodes as $childNode){ $innerHTML .= $childNode->ownerDocument->saveHTML($childNode); } - $outerHTML = $node->ownerDocument->saveHTML($node); - $textcontent = $node->textContent; $result .= '') . '
' . $author . '
'; + //$result .= '' . $item->pubDate . '
'; + + $result .= '' . $summary . '
'; + + $article = file_get_contents($item->url, false, $context); + $doc = new DOMDocument(); + $doc->loadHTML($article); + $finder = new DomXPath($doc); + $nodes = $finder->query('//section[@name="articleBody"]'); + + if (!$nodes->length) + { + echo 'warning: could not get content of "' . $title . '"') . '